Replies: 1 comment 2 replies
-
Ok, so the problem is that: @lit-labs/nextjs, hijacks the middleware file, adding: import '@lit-labs/ssr-react/enable-lit-ssr.js' To the top of the middleware file. And that causes the issue in the Docker container build step. Removing middleware, fixes the issue. Why exactly, does it break in the Docker container, I think has to do with some detection made by the build step, while compiling the middleware, but gimme some time to put a seal on that. Edit: I initially though the issue was the custom page extensions, but not, the problem is somehow the middleware getting that import statement, which ends with |
Beta Was this translation helpful? Give feedback.
2 replies
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.
-
Summary
I've encountered an issue where running
npm run build
completes fine, but running that inside a Dockerfile fails due to an error with@lit-labs/nextjs
. The error looks like this:The error comes from the
next.config.js
file on line 18:If I remove
withLitSSR
, everything is fine, and the build succeeds on both my machine, and the Docker build.I don't think we actually need Lit SSR, and removing it should be possible for our project, but I would need to justify this to the team. Is there a workaround for this, or should I tell everyone we should remove SSR?
Additional information
To recreate this:
Build locally, observe success:
Build Docker, observe failure:
Example
https://github.com/walshms/nextjs-example
Beta Was this translation helpful? Give feedback.
All reactions