You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello everybody,
When i just put this code to assets/js/scripts.js import moment from 'moment-timezone';
and try to build, it show the error Uncaught SyntaxError: Unexpected token 'export' (at main-42e06ae1.js?ver=6.6.1:41:35449)
it work on the development mode, idk why? anyone have fix?
Thanks
The text was updated successfully, but these errors were encountered:
update: replace the code in /inc/inc.vite.php to fix it //wp_enqueue_script('main', DIST_URI . '/' . $js_file, JS_DEPENDENCY, '', JS_LOAD_IN_FOOTER); wp_enqueue_script_module('main', DIST_URI . '/' . $js_file, JS_DEPENDENCY, '');
it change type text/javascript to module
(wp_enqueue_script_module working from Wordpress 6.5)
Hello everybody,
When i just put this code to assets/js/scripts.js
import moment from 'moment-timezone';
and try to build, it show the error
Uncaught SyntaxError: Unexpected token 'export' (at main-42e06ae1.js?ver=6.6.1:41:35449)
it work on the development mode, idk why? anyone have fix?
Thanks
The text was updated successfully, but these errors were encountered: