-
Notifications
You must be signed in to change notification settings - Fork 87
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
Cannot find module 'react-native' #399
Comments
Can you run |
It never shows up there. I did some spelunking in the lock file and did find a thing ( |
@chris-erickson hey chris! i ran this by some engineers who work on https://github.com/netlify/zip-it-and-ship-it. suggestions:
|
Can I do this even if I'm not specifying any functions manually? I'm 100% using Next.js routes (no "api functions"). Happy to try this out a bit but I've extricated the third-party React component that had tentacles in RN for whatever reason.
|
yes, you can! though the main point of trying it would be to see if it resolves the react-native module error that you reported, so i'd try it out on that version of your site. otherwise we can probably mark this as closed! |
I've updated to this, but now am bumping into this problem: #209 {
"errorType": "Runtime.ImportModuleError",
"errorMessage": "Error: Cannot find module '../../chunks/433.js'\nRequire stack:\n- /var/task/netlify/functions/next_petitions_sharecode/next_petitions_sharecode.js\n- /var/task/next_petitions_sharecode.js\n- /var/runtime/UserFunction.js\n- /var/runtime/index.js",
"trace": [
"Runtime.ImportModuleError: Error: Cannot find module '../../chunks/433.js'",
"Require stack:",
"- /var/task/netlify/functions/next_petitions_sharecode/next_petitions_sharecode.js",
"- /var/task/next_petitions_sharecode.js",
"- /var/runtime/UserFunction.js",
"- /var/runtime/index.js",
" at _loadUserApp (/var/runtime/UserFunction.js:100:13)",
" at Object.module.exports.load (/var/runtime/UserFunction.js:140:17)",
" at Object.<anonymous> (/var/runtime/index.js:43:30)",
" at Module._compile (internal/modules/cjs/loader.js:999:30)",
" at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)",
" at Module.load (internal/modules/cjs/loader.js:863:32)",
" at Function.Module._load (internal/modules/cjs/loader.js:708:14)",
" at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)",
" at internal/main/run_main_module.js:17:47"
]
} As one prior error message requested, I added the external modules (for some dynamic imports I use, I suspect): [functions]
node_bundler = "esbuild"
external_node_modules = ["@ampproject/toolbox-optimizer", "next"] |
@chris-erickson that is a duplicate of #337! feel free to close this one then and track on 337 :) |
Will consider closed for now, as there's too many moving parts here for me to pursue it, but once the bundler is working perhaps I can come back to it. Thanks! |
…ses (#399) * test: add test cases for cacheable route handlers * refactor: add cache related types modules and adjust ROUTE variant to match our current usage * feat: add cdn-cache-control headers to cacheable route handler responses * fix: set revalidate setting on request context for Route responses and set cdn-cache-control header based on that * chore: format with prettier * chore: pass just revalidate time not entire meta --------- Co-authored-by: pieh <pieh@users.noreply.github.com>
Describe the bug
When building, I am getting
Cannot find module 'react-native'
.To Reproduce
https://app.netlify.com/sites/resistbot-website-ed6e4f/deploys/60bf9343df755e0008b22f0e
Some reference content that very closely matches my issue:
next-on-netlify
fails to build peer dependencies in deployment netlify/next-on-netlify#103Our repo is private but would gladly give someone collaborator access as needed.
Expected behavior
Not sure what code I use that requires react-native (perhaps conditionally?) but this works locally. Might be correlated to switching to
target: 'experimental-serverless-trace',
but that's not clear.Versions
If you're using the CLI to build
If you're using file-based installation
The text was updated successfully, but these errors were encountered: