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

ERROR in ./node_modules/contentful-sdk-core/dist/es-modules/get-user-agent.js #58

Open
ahasall opened this Issue Apr 30, 2018 · 6 comments

Comments

Projects
None yet
2 participants
@ahasall

ahasall commented Apr 30, 2018

Hello,

I installed the latest Contentful SDK.

When I build my application I have the following error:
ERROR in ./node_modules/contentful-sdk-core/dist/es-modules/get-user-agent.js

When I check the source code of get-user-agent.js if find this:

import { platform, release } from 'os';

Knowing that I build for the web, and that the 'os' module if for Node.js apps, I suppose that this import is the reason for the error.

Do you have any idea about this issue ?

Thanks

@axe312ger

This comment has been minimized.

@ahasall

This comment has been minimized.

ahasall commented Apr 30, 2018

Okay, thank you. I will create the issue on the Angular CLI repository because I don't have direct access to the Webpack config.

@axe312ger

This comment has been minimized.

Member

axe312ger commented Apr 30, 2018

Argh damn, yeah this is nasty :/ Good luck!

@axe312ger axe312ger closed this Apr 30, 2018

@ahasall

This comment has been minimized.

ahasall commented Jul 19, 2018

Hello @axe312ger,
It's me again :)

The Angular CLI team believes that libraries that are meant to run inside the browser are not supposed to use Node API.

I am afraid that they are not willing to provide to override that Webpack config.

Do you plan to add a version of your library that doesn't use those APIs ?

Thanks,
Amadou

@axe312ger

This comment has been minimized.

Member

axe312ger commented Jul 23, 2018

Alright, we will have a look how to avoid importing these node core modules on top level.

@axe312ger axe312ger reopened this Jul 23, 2018

@axe312ger axe312ger added the bug label Jul 23, 2018

@axe312ger axe312ger self-assigned this Jul 23, 2018

@ahasall

This comment has been minimized.

ahasall commented Jul 23, 2018

Thank you very much.

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