Open swamidass opened 2 months ago
Same issue for me as well, which is a blocker.
I upgraded from 2.10.2 to 2.11.2 and encountered the issue then. I would highly prefer not to downgrade.
Actually, even 2.10.2 is having issues for me.
This works
import {LoaderFunctionArgs} from '@vercel/remix'
import {json} from '@remix-run/react'
This breaks with the error above
import {LoaderFunctionArgs, json} from '@vercel/remix'
Looking in the vercel code, defer and router are just pointing to @remix-run/router
anyway, so I've updated my code to refer to it directly and now it is building. Regardless of this workaround, it would be nice to address this.
Thanks for confirming the bug. Perhaps we'll get more help if we can create a mimimal project that reproduces the error? How hard would that be to do?
I've been struggling with the same issue during migration. What worked for me is
vite-plugin-top-level-await is the cause of that problem, try removing that package.
Thanks! Is there an alternate to this package?
What's weird is that I just started to get this error, and I have locked versions:
"@remix-run/node": "2.9.2",
"@remix-run/react": "2.9.2",
"@remix-run/serve": "2.9.2",
"@vercel/remix": "2.9.2",
Trying to see what else has changed which would impact this.
just started seeing this error on 2.13.1 as well
look for the way you import types (may depend on your tsconfig setup). i dont know enough about the inner workings, but this fixed for me:
Reproduction
The error I get:
Using this vite.config.js:
System Info
Used Package Manager
yarn
Expected Behavior
Builds without error.
Actual Behavior
Dev works fine.
But building fails.
The error I get:
Indeed, edge/index.js does import './entry.server.js' , but edge/index.js isn't client code!