Hello, I am trying to create a typescript lib and use it via bun link. The intellisense is loading, yet I get a Module not found: Can't resolve "x"
#Bun link issue
1 messages · Page 1 of 1 (latest)
I can now import but I geta
bun run build
$ next build
.......
Creating an optimized production build ...
Failed to compile.
node:module
Module build failed: UnhandledSchemeError: Reading from "node:module" is not handled by plugins (Unhandled scheme).
Webpack supports "data:" and "file:" URIs by default.
You may need an additional plugin to handle "node:" URIs.
at C:\Users\hello\projects\carbon-panel\node_modules\next\dist\compiled\webpack\bundle5.js:28:401761
at Hook.eval [as callAsync] (eval at create (C:\Users\hello\projects\carbon-panel\node_modules\next\dist\compiled\webpack\bundle5.js:13:28858), <anonymous>:6:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (C:\Users\hello\projects\carbon-panel\node_modules\next\dist\compiled\webpack\bundle5.js:13:26012)
at Object.processResource (C:\Users\hello\projects\carbon-panel\node_modules\next\dist\compiled\webpack\bundle5.js:28:401686)
at processResource (C:\Users\hello\projects\carbon-panel\node_modules\next\dist\compiled\loader-runner\LoaderRunner.js:1:5308)
at iteratePitchingLoaders (C:\Users\hello\projects\carbon-panel\node_modules\next\dist\compiled\loader-runner\LoaderRunner.js:1:4667)
at runLoaders (C:\Users\hello\projects\carbon-panel\node_modules\next\dist\compiled\loader-runner\LoaderRunner.js:1:8590)
at NormalModule._doBuild (C:\Users\hello\projects\carbon-panel\node_modules\next\dist\compiled\webpack\bundle5.js:28:401548)
at NormalModule.build (C:\Users\hello\projects\carbon-panel\node_modules\next\dist\compiled\webpack\bundle5.js:28:403576)
at C:\Users\hello\projects\carbon-panel\node_modules\next\dist\compiled\webpack\bundle5.js:28:82046
Import trace for requested module:
node:module
./node_modules/@carbonhost/typescript/dist/index.js
./src/hooks/carbon/use-carbon-client.ts
> Build failed because of webpack errors
error: script "build" exited with code 1
``` error
webpack: (webpackConfig) => {
webpackConfig.externals = webpackConfig.externals || [];
webpackConfig.externals.push("node:module");
return webpackConfig;
},