require errors during package transpiliation on nextjs app (other platform .node not found) #1858
Unanswered
is-it-ayush
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Where you able to find a workaround for this? |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
Hi! I'm trying to transpile
Package A
(a rust project) that exposes a few functions in my nextjs application (sayPackage B
). The problem is, The build stage of nextjs app fails complaining│ Module not found: Can't resolve '@scope/package_a-linux-arm-gnueabihf
for every other platform (so almost 10 similar errors). MyPackage A
is built usingnapi build --platform --strip --no-const-enum ./bindings
which generates a single.node
file. The error makes sense but how should I workaround the fact that the otherrequire("some_different_platform.node")
is not available during build & just include.node
files that are available in my nextjs bundle.One of the workarounds that I'm aware of is to simply not transpile the package at all. In this case, I would have to manually make sure the package is present after compilation when I run
next dev
. Although, This is not what I'm hoping for.Beta Was this translation helpful? Give feedback.
All reactions