Uncaught SyntaxError in ESM supported Chrome 61 #5336
Unanswered
hyunbinseo
asked this question in
Q&A
Replies: 2 comments 2 replies
-
Chrome auto-updates. Why would anyone ever be using Chrome 61? |
Beta Was this translation helpful? Give feedback.
1 reply
-
Hello, |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Vite's default browser support baseline is Native ESM according to these sources.
Therefore, I was targeting browsers that supported
<script type="module">
.This includes Chrome 61 and above, according to caniuse.com and MDN Web docs.
△ ESM support: Chrome 61 ✅ Chrome 60 ❎
However, when attempting to load a SvelteKit built website in Chromium 61, the following error occurs.
△
<script type="module" data-sveltekit-hydrate="13pf6wa">
:Uncaught SyntaxError: Unexpected token import
Questions
data-sveltekit-hydrate
attribute in<script type="module">
.Notes
[email protected]
and a Skeleton project template.tsconfig.json
, setting thecompilerOptions.target
andcompilerOptions.module
toES6
does not resolve the issue.<script nomodule>
is not possible. Chrome 61 supports<script type="module">
.Reproduction
npm create svelte my-app
.npm run install
→npm run build
→npm run preview
localhost:3000
with the above web browser.Beta Was this translation helpful? Give feedback.
All reactions