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
Appreciate this is likely going to be instantly closed, but despite my efforts... my reproduction repo works! and would be very time consuming to setup as near identical as it's a php app using vite..., really struggling to find a solution so I don't know where else to turn would appreciate some pointers to investigate this further.
When running the dev server my app works fine... no issues.
When running a production build npm run build, it builds ok, but when viewing a webpage in browser, the js console shows the vendor.js bundle file hits a syntax error.
Of course it's all minified/mangled (and turning minify off in vite config makes no difference), line 23 above:
function Ji(e, t, n, r) {
const s = new SyntaxError(String(e));
return s.code = e,
s.loc = t,
s
}
I guess sourcemaps are not working as they should here but, I found that this line it complains about is node_modules/@vue/compiler-core/dist/compiler-core.esm-bundler.js:L14.
This unknown SyntaxError is only hit where I try attach a basic vue component to a vue root instance.
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
I found that this was linked to a dynamic content issue... causing a template error. A new line being added to an inline property in the markup specifically.
This was revealed while running the dev-server when I finally had matching content across environments.
Unfortunately though... having cleared 100% of Vue warnings in the js console where dev server is running, then trying production build locally, I get a slightly different one vendor.a9b4a9a1.js:formatted:5262 Uncaught SyntaxError: 15.
Is there a way to make these errors way more verbose on production builds?
Aaaaaand... figured out WHY, it was my php application minifying the markup that the vue components use as their templates. Of course this is entirely why I could not see the issue on anything but uat/production environments.
The contents of a <script type="text/x-template"> were over minified and the inline properties have no spaces which of course is an issue and wouldn't expect vue to make sense of that. As an example:
Describe the bug
Appreciate this is likely going to be instantly closed, but despite my efforts... my reproduction repo works! and would be very time consuming to setup as near identical as it's a php app using vite..., really struggling to find a solution so I don't know where else to turn would appreciate some pointers to investigate this further.
When running the dev server my app works fine... no issues.
When running a production build
npm run build
, it builds ok, but when viewing a webpage in browser, the js console shows the vendor.js bundle file hits a syntax error.Of course it's all minified/mangled (and turning minify off in vite config makes no difference), line 23 above:
I guess sourcemaps are not working as they should here but, I found that this line it complains about is
node_modules/@vue/compiler-core/dist/compiler-core.esm-bundler.js:L14
.This unknown SyntaxError is only hit where I try attach a basic vue component to a vue root instance.
Thanks for your hard work and efforts
Reproduction
will try get the working one public tomorrow, eyes closing involuntarily rn
System Info
Used Package Manager
npm
Logs
Validations
The text was updated successfully, but these errors were encountered: