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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Module not found: Error: Can't resolve 'fs' in 'C:\digital-b2c-channel-web-app\node_modules\applicationinsights\out\Library' #1204

Open
kiran8983 opened this issue Sep 5, 2023 · 4 comments

Comments

@kiran8983
Copy link

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

  1. Clone the project or navigate to the project directory.

  2. Run the yarn storybook build command. which internally runs following:
    yarn add loader-utils --cmd-install && cross-env NODE_OPTIONS=--openssl-legacy-provider build-storybook -s ./public -o ./storybook-output

  3. Observe the error mentioned above.

  • SDK Version: Next.js 13.3.1
  • How you initialized the SDK: I ran the yarn storybook build command.

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.

@MSNev
Copy link

MSNev commented Sep 7, 2023

This looks like the node SDK and not this SDK (browser focused)???

Transfering to the node github

@MSNev MSNev transferred this issue from microsoft/ApplicationInsights-JS Sep 7, 2023
@MSNev
Copy link

MSNev commented Sep 7, 2023

@JacksonWeber / @hectorhdzg ??

@hectorhdzg
Copy link
Member

@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?

@JacksonWeber
Copy link
Contributor

@kiran8983 Were you able to determine if you were running the Node.js SDK in a non-server part of your Next.js code?

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

No branches or pull requests

4 participants