question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Export * syntax not supported

See original GitHub issue

When trying to use bokehjs together with npm and create-react-app the compiler gives an error. This can be easily reproduced by building the following dockerfile and running it after

FROM node:12
WORKDIR /usr/src/app
RUN npx create-react-app bokehbug --template typescript
WORKDIR /usr/src/app/bokehbug/src
RUN wget https://gist.githubusercontent.com/bsdis/415a77d017c32d2678cefd9a0a23fb22/raw/83a7a91fb82420a550b8ad66f8001034fc1dab69/App.tsx -O App.tsx
WORKDIR /usr/src/app/bokehbug
RUN wget https://gist.githubusercontent.com/bsdis/415a77d017c32d2678cefd9a0a23fb22/raw/83a7a91fb82420a550b8ad66f8001034fc1dab69/package.json -O package.json
RUN npm install
CMD npm start

Build this dockerfile by first installing docker and then use docker build -t bbug … To see the error after building, run:

docker run -it --name bokehbug -p 3000:3000 bbug bash

and when in the container run

npm start

The observed error is:

zuifrontend_1  | Failed to compile.
zuifrontend_1  |
zuifrontend_1  | ./node_modules/@bokeh/bokehjs/build/js/lib/index.js 3:9
zuifrontend_1  | Module parse failed: Unexpected token (3:9)
zuifrontend_1  | File was processed with these loaders:
zuifrontend_1  |  * ./node_modules/babel-loader/lib/index.js
zuifrontend_1  | You may need an additional loader to handle the result of these loaders.
zuifrontend_1  | | export { version } from "./version";
zuifrontend_1  | | export { index } from "./embed";
zuifrontend_1  | > export * as embed from "./embed";
zuifrontend_1  | | export * as protocol from "./protocol";
zuifrontend_1  | | export * as _testing from "./testing";

The problem is not with node (12.x or whichever), because bokehjs is not a node library, but it’s web browser library. So bokehjs’ code is not run in node at any point in time, it’s just being processed by node libraries like babel-loader, which apparently doesn’t recognize this pretty new ES export star syntax. Is it possible to upgrade the babel library in CRA so that it can support libraries in node_modules that uses this export * syntax?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
existentialismcommented, Apr 4, 2020

FYI, we enabled support for parsing export * as ns from "foo" by default to @babel/parser (in #10521) but not to @babel/preset-env.

We’ll have a fix for this shortly, feel free to follow: https://github.com/babel/babel/issues/11363

0reactions
stale[bot]commented, May 13, 2020

This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Import and export declarations are not supported yet (in TS)
The problem When trying to use import or export statements in TypeScript (*.ts) files esli... Tagged with typescript, javascript, eslint.
Read more >
ES2015 module import and export syntax error - Stack Overflow
The ES2015 module import and export syntax is not supported by any browser at the time I write this answer (04/2016). The error...
Read more >
export - JavaScript - MDN Web Docs
The export declaration is used to export values from a JavaScript module. Exported values can then be imported into other programs with the ......
Read more >
decorator after export keyword produces syntax error.
WebStorm shows syntax error after export keyword, but this is valid code. ... "Using the export keyword between a decorator and a class...
Read more >
Exporting table data | BigQuery - Google Cloud
You cannot export table data to a local file, to Sheets, or to Drive. The only supported export location is Cloud Storage. For...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found