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

From-To-Picker is being imported incorrectly into StopsOverlay #54

Closed
PaulIvanov opened this issue Feb 3, 2020 · 1 comment · Fixed by #55
Closed

From-To-Picker is being imported incorrectly into StopsOverlay #54

PaulIvanov opened this issue Feb 3, 2020 · 1 comment · Fixed by #55
Assignees
Labels
AS1 bug Something isn't working HIGH High Priority

Comments

@PaulIvanov
Copy link

When attempting to use the StopsOverlay package inside of the new trimet.org site, we ran into a webpack build error, that we believe is a symptom of a bigger issue:

ERROR #98123  WEBPACK
Generating development JavaScript bundle failed
Unexpected token (11:14)
File: node_modules\@opentripplanner\from-to-location-picker\src\index.js:11:14

The contents of that file (and otp-ui in general) look to be utilizing "@babel/plugin-proposal-class-properties": "^7.7.4",. The class properties in FromToLocationPicker havent been transpiled into valid JS within the library, so our webpack build fails.

After digging deeper into this, to find a solution, we believe the offending line of code is within packages that contain a module:

 "main": "lib/index.js",
  "module": "src/index.js",

We found an SO issue discussing the module item makes es6 module imports to use the specified file instead of the minified lib code: https://stackoverflow.com/a/47537198/4625508. We arent fully sure if this is the cause/root of the webpack issue, But we think its a solid starting point for continuing to investigate the underlying issue.

@PaulIvanov
Copy link
Author

@fpurcell this is a blocking issue that prevents us from implementing the StopsOverlay in the Trimet.org site

fpurcell added a commit to OpenTransitTools-BonePile/older-pre-refactor-veh-otp-ui that referenced this issue Feb 3, 2020
…ackage.json ... just use main=lib/index.js
@fpurcell fpurcell self-assigned this Feb 3, 2020
@fpurcell fpurcell added bug Something isn't working HIGH High Priority labels Feb 3, 2020
fpurcell added a commit that referenced this issue Feb 3, 2020
fix(package.json): fixes #54 -- remove 'module' from project.json
@fpurcell fpurcell added AS2 AS1 and removed AS2 labels Mar 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AS1 bug Something isn't working HIGH High Priority
Projects
None yet
2 participants