-
Notifications
You must be signed in to change notification settings - Fork 375
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]: Package subpath './koa' is not defined #5154
Comments
Following this up, I tried again using
|
Faced same issue, changed all imports from |
Thanks for that @chist3r ! I didn't think to try that and doing this enabled the build to work. So it seems then either the bug is: I'm not a deep node/js expert so I'll leave the fix to those who know what they are doing 😅 |
Thanks for the feedback, let's fix this document problem, and welcome PR~ |
It seems that the above issue was probably only a bug for that version of the framework. Thanks all. |
Version
Details
I'm getting an issue attempting to run a
yarn build
on a project that uses theuseContext
hook in a Functions BFF api.Any time I include the context hook, the build fails with the following output:
Launching the same codebase in development mode works however (
yarn dev
) and the site functions as expected.I would expect that the build should work in this case.
Reproduce link
https://github.com/botagar/modernjs-build-issue
Reproduce Steps
Create a new Web App as per the quickstart guide (https://modernjs.dev/en/guides/get-started/quick-start.html) using TS, Yarn, RS Pack.
Update all packages to latest published versions. I use
yarn-check -u
(needs to be installed globallynpm install -g yarn-check
).Enable BFF in Function mode (https://modernjs.dev/en/guides/advanced-features/bff/function.html) with Koa as the engine.
In any of the API functions, import the
useContext
hook (https://modernjs.dev/en/apis/app/runtime/bff/use-context.html) and use it for anything.Run a
yarn build
and watch it fail.The text was updated successfully, but these errors were encountered: