-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Bug: everything that's needed should be in the output directory #14
Comments
@dario-piotrowicz I took a quick look at this and have some comments:
At least part of why some file are not bundled by this pass is that they are not required. That is not the only patch adding deps that will be pick up by I should tackle some of this over the next few days.
I think this is no more applicable. |
Is there a specific problem you think this was causing? |
yes, I am pretty sure #148 and #219 do require this to be fixed before we can properly address those I bet there are other problems that can't be fixed without this addressed If needed I can go back to the issues and provide here a more detailed explanation |
I completely do no understand this.... are you saying we will always need to rely on wrangler's bundling? if that's the case that doesn't sound right at all to me, the two different bundles should both live under the |
Hum... I would say "plan" rather than "need" here.
That's
That's in worker.ts
I believe lazy loading is possible in bundling mode using |
I think we already discussed about this and I think we confuse each other because "wrangler bundling" is just a confusing term in my opinion. When I talk about bundling I mean in the true/strict sense, as in the fact you have N different js/ts files (which might include dependencies) and they all become a single js file that you can then send to Cloudflare, that's what I believe we do need not to depend on. Bundling in the sense that we perform transformations on files and do some per-file bundling and whatnot, but allow lazy loading thought |
Hey @dario-piotrowicz, When #295 is merged, you can generate meta file in debug mode. There is one file per bundle (i.e. one for the middleware and an other for the server) located alongside the output with a You need to set OPEN_NEXT_DEBUG=1 node /path/to/opennextjs-cloudflare/packages/cloudflare/dist/cli/index.js I hope the meta files contain all the info you need. Let me know otherwise. edit: I added a second commit to the PR and the cloudflare bundle (handler.mjs) has the Thanks! |
The build does output a worker in the specified output directory (defaulting to
.next-worker
).This directory should contain everything that's required to run the worker (assets included).
But this is not so, as there are clear signs that files within
.next-worker
make use of files outside of the directory (making the dev/deployment of unbundled workers (--no-bundle
) impossible).For example:
pages.runtime.prod.js
fileI'm not sure how those files are not getting bundled by the esbuild build step 😕
We should make sure that they are actually bundled in, or if that's not possible, everything that the worker requires should just need to live in the output directory and no external file/dependency should be needed (in other words, I think that we need to make sure that
wrangler dev --no-bundle
works).The text was updated successfully, but these errors were encountered: