FredKSchott / snowpack

ESM-powered frontend build tool. Instant, lightweight, unbundled development. ✌️
https://www.snowpack.dev
MIT License
19.48k stars 922 forks source link

error when installing`deck.gl` #396

Closed wufeihuang closed 4 years ago

wufeihuang commented 4 years ago

Error occurs when importing deck.gl in the project.

I started a project with @snowpack/app-template-react, and tried to use deck.gl in it. But it went wrong.

import {DeckGL} from 'deck.gl'

image

I tried to import deck.gl in a new project with create-react-app, it runs well.

alextes commented 4 years ago

Experiencing the same with @shopify/polaris .

It appears it imports a package (@shopify/polaris-tokens) that looks as follows:

module.exports = {
  colorBlack: 'rgb(0, 0, 0)',
  colorWhite: 'rgb(255, 255, 255)',
  durationBase: 200,
};

which @shopify/polaris is importing like so:

import tokens, { durationBase } from '@shopify/polaris-tokens';

error is:

✖ snowpack failed to load node_modules/@shopify/polaris/index.es.js
  'durationBase' is not exported by node_modules/@shopify/polaris-tokens/index.js, imported by node_modules/@shopify/polaris/index.es.js
alextes commented 4 years ago

Hmm, their build is a bit complex. Don't have any more pointers. Perhaps interesting to note that their codebase doesn't contain the above import as-is but it is generated by rollup.

yuheiy commented 4 years ago

I've had the same problem with flubber. https://github.com/veltman/flubber

FredKSchott commented 4 years ago

deck.gl and flubber should be fixed by https://github.com/pikapkg/snowpack/pull/421. You can try it out today using the pre-built PR package: https://github.com/pikapkg/snowpack/pull/421/checks

@shopify/polaris may be fixed as well, but not certain. If not, it will at least now be easier to fix

FredKSchott commented 4 years ago

Moving to our message board

pika-ci[bot] commented 4 years ago

:truck: This issue has been moved! Continue the discussion on our project message board: https://www.pika.dev/npm/snowpack/discuss/299What is this?