Nuxt SSG results in runtime error on Safari
See original GitHub issueReproduction
https://codesandbox.io/s/formkit-nuxt-ssr-minimal-dnikdj
Describe the bug
The app won’t render and returns the following error in the dev tools of Safari:
SyntaxError: Invalid regular expression: range out of order in character class
To reproduce, look at the reproduction link, then:
- run
yarn generate
- run a static HTTP server from the files in
.output/public
(an easy way to do so is to executecd .output/public
and thenpython -m http.server 8000
if you have python installed, the website should be navigated from safari at http://localhost:8000).
Note that this bug does not appear when running through node (or when executing the dev
or preview
commands of the nuxt cli).
Environment
- Operating System:
Darwin
(Mac OS) - Node Version:
v16.14.2
- Nuxt Version:
3.0.0-rc.4
- Package Manager:
yarn@1.22.15
- Builder:
vite
- User Config:
-
- Runtime Modules:
-
- Build Modules:
-
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:13 (7 by maintainers)
Top Results From Across the Web
Server Side Rendering - Nuxt
Server-side rendering (SSR), is the ability of an application to contribute by displaying the web-page on the server instead of rendering it in...
Read more >Hydration failed because the initial UI does not match ... - GitHub
I got this error too and i delete ".next" folder and run "npm run dev" and it ... in the browser it will...
Read more >Safari Runtime Error - Apple Community
Everytime I go onto MySpace, the log in page comes up and I type in my password. When I click Log-In, Safari shows...
Read more >react-hydration-error - Next.js
When css-in-js libraries are not set up for pre-rendering (SSR/SSG) it will often lead to a hydration mismatch. In general this means the...
Read more >Vue meta not getting updates - Stack Overflow
Recently I've read an article that because vue-meta (Vue in general) loads based on JavaScript Social media crawlers will not cache them ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok — I was finally able to track this down. The only way I could reproduce the bug was using your python server. The issue is that the python server is not setting the charset to utf-8 in the
Content-Type
header on the javascript file responses. So any UTF-8 characters in your JS files die. Howeverserve
and other servers do return the charset with the content type:FormKit will continue to require UTF-8 support, but if you really need to get it working without UTF-8 you can remove the
alpha
,alpha_spaces
andalpha_numeric
validation rules from your build by using a custom FormKit configuration (notdefaultConfig
). Currently those are the only places in FormKit where UTF-8 characters are used. However, I cannot guarantee that other UTF-8 characters wont be introduced at some point in the future.I’m going to close this, but I appreciate you bringing it up, its a new one to me.
maybe you need a meta tag on your page for charset?