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

Field 'browser' doesn't contain a valid alias configuration using Webpack #62

Open
erdostom opened this issue Jan 3, 2020 · 3 comments · May be fixed by #69
Open

Field 'browser' doesn't contain a valid alias configuration using Webpack #62

erdostom opened this issue Jan 3, 2020 · 3 comments · May be fixed by #69
Labels
bug Something isn't working

Comments

@erdostom
Copy link
Contributor

erdostom commented Jan 3, 2020

I'm trying to use the latest version (HEAD, not released) using Webpack and I get this error. Using the latest official npm release doesn't have this problem.

image

@erdostom erdostom added the bug Something isn't working label Jan 3, 2020
@timqian
Copy link
Owner

timqian commented Jan 4, 2020

Looks the module is not successfully imported. But I haven't tried doing this use webpack
How do you import chart.xkcd?

@erdostom
Copy link
Contributor Author

erdostom commented Jan 4, 2020

I import using import charts from 'chart.xkcd'

Something is wrong with the way the modules are exported. If I use the latest npm version the above import works fine, but master from this repo fails.

Can be replicated with

  1. create-react-app test (yarn global add create-react-app if you don't have it)
  2. yarn add https://github.com/timqian/chart.xkcd
  3. import charts from 'chart.xkcd' in src/App.js
  4. get error below

image

@golopot
Copy link

golopot commented May 24, 2020

The build script is not executed when people install this package by yarn add https://github.com/timqian/chart.xkcd, so there is no dist in the installed package. One way to solve this is to change prepublishOnly in package.json to prepublish or prepare, that way the build step will be executed.

@erdostom erdostom linked a pull request May 26, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants