-
-
Notifications
You must be signed in to change notification settings - Fork 173
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
AWS CRT binary not present in any of the following locations issue on Next.js app while using aws-iot-device-sdk-v2 #2462
Comments
node Binaries cannot be shared over federation. You will have to mark them as externals and install them into applications for use at runtime. |
@ScriptedAlchemy The Next.js app, integrating 'aws-iot-device-sdk-v2' without the module federation package, runs seamlessly. |
yes because you are not trying to pull a binary file over the internet, its on disk like normal.
It works in nextjs because its installed there on the app so it can find it since next server makes all node_modules externals and makes a big zip file of the node module dir. When sharing code, i disable externalization of the node modules so that its bundled, but i cant put node binarys in .js files. Id have to patch the filesystem of node as a whole plus you would need to exose all node modules to the internet incase theres a binary somewhere in there that would be needed. Dont share whatever uses the package binary, add it as "externals" and install it seperately into all apps |
@ScriptedAlchemy We need the |
config.externals.push('aws-iot-device-sdk-v2') and dont put it in shared of module federation. |
@ScriptedAlchemy Could you please give any example for webpack config.externals on Nextjs app? |
Only add externals to server build |
@ScriptedAlchemy The issue persists. I need to use the aws-iot-device-sdk-v2 package for local development. When trying to build, the same issue occurs. |
Were you ever able to get it working? Running into the same issue. |
Describe the bug
I facing an issue after installing the
aws-iot-device-sdk-v2
package in a Next.js app using Module federation. After importingiot
andmqtt
, I attempt to run the Next.js app using npm run dev but encounter the below errors. I am facing this issue only when I am using @module-federation/nextjs-mf, and if I remove the module federation configuration the issue is not occuringReproduction Steps
aws-iot-device-sdk-v2
on the Nextjs app which is using Module federation.iot
andmqtt
from'aws-iot-device-sdk-v2'
andiot
andmqtt
APIs are used on the Nextjs app component.npm run dev
on terminalReproduction link
Container App: https://github.com/hari-prasad-a/mqtt-container-app
Child App: https://github.com/hari-prasad-a/mqtt-child-app
Expected Behavior
After importing
iot
andmqtt
from'aws-iot-device-sdk-v2'
the nextjs app running as we expect normallyCurrent Behavior
Currently, it's throwing the below error we can
import { iot, mqtt } from 'aws-iot-device-sdk-v2'
on the Nextjs app component and run on it.Used Package Manager
npm
System Info
Validations
The text was updated successfully, but these errors were encountered: