[BUG] Module not found: Error: Can't resolve 'fs' in 'C:\digital-b2c-channel-web-app\node_modules\applicationinsights\out\Library'
Description/Screenshot
Module not found: Error: Can't resolve 'fs' in 'C:\digital-b2c-channel-web-app\node_modules\applicationinsights\out\Library'
Steps to Reproduce
-
Clone the project or navigate to the project directory.
-
Run the
yarn storybook buildcommand. which internally runs following: yarn add loader-utils --cmd-install && cross-env NODE_OPTIONS=--openssl-legacy-provider build-storybook -s ./public -o ./storybook-output -
Observe the error mentioned above.
- SDK Version: Next.js 13.3.1
-
How you initialized the SDK: I ran the
yarn storybook buildcommand.
Expected behavior
I expected the yarn storybook build command to run successfully without any errors.
Actual behavior I encountered the error message mentioned above, and the build process failed.
Additional context
This error seems to be related to the fs module in the applicationinsights package. It appears to be blocking the build process.
This looks like the node SDK and not this SDK (browser focused)???
Transfering to the node github
@JacksonWeber / @hectorhdzg ??
@kiran8983 this is usually the kind of error when you try to run Node.js SDK in the browser or some where Node.js native libraries are not available, not super familiar with next.js but maybe this is related to way you are building your app?
@kiran8983 Were you able to determine if you were running the Node.js SDK in a non-server part of your Next.js code?