SyntaxError: Unexpected token '?', SyntaxError: Unexpected token '.'
Hey everyone! On iPhone devices with Safari version 13 and below, this error appears in the console and the page does not display correctly. Could you help me why this is happening?
14 Replies
https://caniuse.com/mdn-javascript_operators_optional_chaining
Would be my guess
Yes you are right. Can I fix this problem somehow? I tried "@babel/preset-env" to compile but it didn't work.
Perhaps try setting vite.build.target to something like es2015 in your nuxt config
Vite
Next Generation Frontend Tooling
I use webpack as builder
Well then you need to set the build target for webpack to e.g. es2015
Could you help me where can i find a resource;
I never had to use webpack with nuxt 3 but https://nuxt.com/docs/api/configuration/nuxt-config#webpack-1 might be a start
Nuxt
Nuxt Configuration Reference · Nuxt
Discover all the options you can use in your nuxt.config.ts file.
I can't find something. If someone else can help, let me know! Thank you anyway @warflash
GitHub
top-level
target
option · Issue #14893 · nuxt/nuxtDescribe the feature There are quite a few different locations where target is relevant, including within both nitro rollup, nitro esbuild, vite esbuild, vite optimizeDeps esbuild, vite target, etc...
This issue is still open... if there is anything else you could suggest, I would appreciate it!
Checking the linked issues is always recommended
GitHub
Nuxt 3 not working on iOS <= 12 · Issue #19328 · nuxt/nuxt
Environment Operating System: Darwin Node Version: v14.20.1 Nuxt Version: 3.2.2 Nitro Version: 2.2.3 Package Manager: [email protected] Builder: vite User Config: - Runtime Modules: - Build Modules: - Re...
Thanks for your answer! My problem is that I have webpack as a bundler and I can't figure out how to set the target