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.

Babel error when using greenlet on create-react-app 2.x

See original GitHub issue

Is this a bug report?

Yes

Did you try recovering your dependencies?

No, reproducible on a brand new project.

Which terms did you search for in User Guide?

N/A

Environment

  System:
    OS: macOS 10.14.1
    CPU: x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
  Binaries:
    Node: 10.11.0 - /usr/local/bin/node
    Yarn: 1.9.4 - /usr/local/bin/yarn
    npm: 6.4.1 - /usr/local/bin/npm
  Browsers:
    Chrome: 70.0.3538.77
    Firefox: 60.0.1
    Safari: 12.0.1
  npmPackages:
    react: ^16.6.1 => 16.6.1 
    react-dom: ^16.6.1 => 16.6.1 
    react-scripts: 2.1.1 => 2.1.1 
  npmGlobalPackages:
    create-react-app: Not Found

Steps to Reproduce

  1. Inside of a new create-react-app project, install greenlet (npm i greenlet)
  2. Wrap any function in greenlet HOF
  3. Include a spread operation inside of that function

Expected Behavior

In version 1.x of CRA, this was working without any issue. (I still have CRA 1.x deployed in production, I am working on upgrading)

Actual Behavior

An error occurs: ReferenceError: _Users_sjesso_workspace_greenlet_spread_issue_node_modules_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ is not defined

screen shot 2018-11-10 at 2 24 34 pm 1

Reproducible Demo

I have attached a zip of a basic project that reproduces the problem to this ticket. It is an out-of-the-box CRA with greenlet installed and an example function written. If you change line 38 from return {...{time: Date.now()}}; to return {time: Date.now()}; then the code will run fine.

I removed the node_modules folder to make the zip a reasonable size, so don’t forget to npm i before running!

greenlet-spread-issue.zip

Additional Context

We use greenlet in to make dealing with webworkers easier. In our app, we have a page that needs to load in excess of 50,000 records from an API call for reporting purposes. The data we receive back from the API needs to be massaged into data structures that are easy to work with in our charting library, and this work is done inside of a webworker to avoid blocking the main thread.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
andrewconnorscommented, Nov 14, 2018

I am also getting this. I am running the same OS as OP if that makes a difference. Same stack trace as Tony, posted here just in case:

screen shot 2018-11-14 at 7 13 26 pm
1reaction
TonyXicommented, Nov 14, 2018

capture

Read more comments on GitHub >

github_iconTop Results From Across the Web

create-react-app always throws babel error - Stack Overflow
In your machine user folder there is a node_modules directory and package-lock.json remove them using rm -rf User/node_modules and rm -rf ...
Read more >
Create React App 2.0: Babel 7, Sass, and More
Updating a Project to Create React App 2.0​​ Open package. json in the root of your project and find react-scripts there. Run npm...
Read more >
Hello, Create React App 2.0! - Telerik
In this blog post, Eric Bishard will walk you through what's changed in Create React App and how you can use it in...
Read more >
Create React App without Create React App - Bits and Pieces
This article talks about the process of creating react app without using any libraries or frameworks such as “create-react-app” , “NextJS” etc.
Read more >
Using and writing custom babel macros with create-react-app v2
The last beta of create - react - app v2 has been published (https://github.com/facebook/ create - react - app /issues/5103) and it comes...
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