Skip to content
This repository has been archived by the owner on Dec 3, 2019. It is now read-only.

Problem with the dependency of latest @babel/runtime helpers #87

Closed
hijiangtao opened this issue Dec 10, 2018 · 4 comments
Closed

Problem with the dependency of latest @babel/runtime helpers #87

hijiangtao opened this issue Dec 10, 2018 · 4 comments

Comments

@hijiangtao
Copy link

hijiangtao commented Dec 10, 2018

I met a problem when I install and use deck.gl I traced the error and found it's a problem of viewport-mercator-project's dependency.

The error shows as below:

Module not found: 
Can't resolve '@babel/runtime/helpers/esm/assertThisInitialized' in
'/site/node_modules/[email protected]@viewport-mercator-project/dist/esm'

The package's version is 5.3.0.

Install deck.gl in your project with npm install deck.gl(first time, or use @latest tag when install the package) and run any code that includes deck.gl can reproduce the problem, here is my code:

import React, { Component } from 'react';
import DeckGL, {LineLayer} from 'deck.gl';

class SpatioTemporalMap extends Component {
  render() {
    const viewState = {
      longitude: -122.41669,
      latitude: 37.7853,
      zoom: 13,
      pitch: 0,
      bearing: 0,
    };

    const data = [{sourcePosition: [-122.41669, 37.7853], targetPosition: [-122.41669, 37.781]}];

    const layers = [
      new LineLayer({id: 'line-layer', data}),
    ];

    return (
      <DeckGL viewState={viewState} layers={layers} />
    );
  }
}
  
export default SpatioTemporalMap;

There is a similar problem in luma.gl visgl/luma.gl#805 , and I don't know if there is any other dependency of deck.gl exists the same problem.

I thought downgrade the version of related dependencies should work.

Related issues or problems

@hijiangtao
Copy link
Author

It seems @babel/runtime renamed es6 to esm and caused the can't find module problem. See more at babel/babel#8266 (comment) .

Because of the repo I developed itself can't modify its' babel version casually (@babel/runtime before v7.0.0-beta56), currently I can only copy the folder in @babel/runtime/helpers/es6 to @babel/runtime/helpers/esm and solve the problem temporarily.

@TrySound
Copy link
Contributor

@hijiangtao Which version is specified in your project? Is it exact or with caret?

@ibgreen
Copy link
Contributor

ibgreen commented Dec 10, 2018

@TrySound Also see discussion in visgl/luma.gl#805.

@hijiangtao
Copy link
Author

@TrySound I specified the version to v7.0.0-beta46 and I thought I found the reason of it. More details can be found in the discussion visgl/luma.gl#805 (comment) .

And I think the issue can be closed, since that's not an internal problem of viewport-mercator-project or other deck.gl related dependencies.

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

No branches or pull requests

3 participants