At the time of writing this issue (current commit) the hello-world app is still not successfully running, but it should hopefully be close to it.
To get the application to the current state a series of temporary hacks/workaround were introduced, those should be cleaned up and re-implemented in a stable way.
This issue is for the removal of one of such hacks/workarounds.
This is introduced simply to remove the following wrangler dev warnings:
(but not shimming the module doesn't seem to cause the application not to work)
We should investigate the module and in particular answer the following:
does stubbing the module out can break some Next.js functionality? (what does the module do?) or is it ok to just stub this out to an empty shim? (or a similar solution)
the eval calls are for requiring some modules, why is the code like this? could we just somehow replace the eval("require") calls with proper requires?
Intro
The repository current goal is to get a minimal hello-world Next.js api app running using
wrangler dev
.At the time of writing this issue (current commit) the hello-world app is still not successfully running, but it should hopefully be close to it.
To get the application to the current state a series of temporary hacks/workaround were introduced, those should be cleaned up and re-implemented in a stable way.
This issue is for the removal of one of such hacks/workarounds.
The hack/workaround
The
next/dist/compiled/ws
import is aliased during the worker build: https://github.com/dario-piotrowicz/poc-build-nextjs-app-for-cf-workers/blob/d380bbf8cf8e744d2261751457636b808f13c762/nextjs-worker-builder/src/build/build-worker/index.ts#L63-L66This is introduced simply to remove the following
wrangler dev
warnings:(but not shimming the module doesn't seem to cause the application not to work)
We should investigate the module and in particular answer the following:
eval
calls are for requiring some modules, why is the code like this? could we just somehow replace theeval("require")
calls with properrequire
s?