Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: on build time can't resolve readable-stream and external not allowed #2461

Open
AliD201 opened this issue May 7, 2024 · 0 comments
Open

Comments

@AliD201
Copy link

AliD201 commented May 7, 2024

馃攷 Search Terms

can't resolve readable-stream

The problem

When building for cloudflare deployment using cloudflare preset on nuxt3 + vite
I receive the following errors

[plugin node-resolve] Could not resolve import "unenv/runtime/node/string_decoder/index/" in J:\[REDACTED]\node_modules\winston\node_modules\readable-stream\lib\_stream_readable.js using exports defined in J:\[REDACTED]\node_modules\unenv\package.json.

[nitro 11:56:04 PM]  ERROR  Error: Cannot resolve "unenv/runtime/node/string_decoder/index/" from "J:\\[REDACTED]\\node_modules\\winston\\node_modules\\readable-stream\\lib\\_stream_readable.js" and externals are not allowed!


undefined


ble-stream\\lib\\_stream_readable.js" and externals are not allowed!

  at Object.resolveId (/J:/[REDACTED]/node_modules/nitropack/dist/nitro.mjs:1966:17)
  at async PluginDriver.hookFirstAndGetPlugin (/J:/[REDACTED]/node_modules/rollup/dist/es/shared/node-entry.js:19678:28)
  at async resolveId (/J:/[REDACTED]/node_modules/rollup/dist/es/shared/node-entry.js:18359:26)
  at async ModuleLoader.resolveId (/J:/[REDACTED]/node_modules/rollup/dist/es/shared/node-entry.js:18762:15)
  at async PluginDriver.hookFirstAndGetPlugin (/J:/[REDACTED]/node_modules/rollup/dist/es/shared/node-entry.js:19678:28)
  at async resolveId (/J:/[REDACTED]/node_modules/rollup/dist/es/shared/node-entry.js:18359:26)
  at async ModuleLoader.resolveId (/J:/[REDACTED]/node_modules/rollup/dist/es/shared/node-entry.js:18762:15)
  at async /J:/[REDACTED]/node_modules/@rollup/plugin-commonjs/dist/es/index.js:785:16
  at async Promise.all (index 10)
  at async /J:/[REDACTED]/node_modules/@rollup/plugin-commonjs/dist/es/index.js:777:32
  at async rewriteRequireExpressionsAndGetImportBlock (/J:/[REDACTED]/node_modules/@rollup/plugin-commonjs/dist/es/index.js:1354:28)
  at async transformCommonjs (/J:/[REDACTED]/node_modules/@rollup/plugin-commonjs/dist/es/index.js:1928:23)
  at async ModuleLoader.addModuleSource (/J:/[REDACTED]/node_modules/rollup/dist/es/shared/node-entry.js:18896:36)



[11:56:04 PM]  ERROR  Cannot resolve "unenv/runtime/node/string_decoder/index/" from "J:\\[REDACTED]\\node_modules\\winston\\node_modules\\readable-stream\\lib\\_stream_readable.js" and externals are not allowed!

What version of Winston presents the issue?

3.12.0

What version of Node are you using?

v21.6.1

If this worked in a previous version of Winston, which was it?

No response

Minimum Working Example

Simply you can just load a fresh nuxt3 app

add the packege and just create the logger anywhere server side

in nuxt.config.ts add:

  nitro: {
    preset: "cloudflare-pages",
    prerender: {
      autoSubfolderIndex: false
    }
  }

Additional information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant