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

Uncaught ReferenceError: _typeof is not defined #874

Closed
adesurirey opened this issue Aug 23, 2019 · 1 comment
Closed

Uncaught ReferenceError: _typeof is not defined #874

adesurirey opened this issue Aug 23, 2019 · 1 comment

Comments

@adesurirey
Copy link

adesurirey commented Aug 23, 2019

Trying to work with react-map-gl but can't get the simplest lib example to work. I have only a gray background with mapbox logo on it. As soon as I try to render the map component I get this weird error in console which I'm unable to understand:

Uncaught ReferenceError: _typeof is not defined
    at mr (blob:http://localhos…6-19b5d5c80288:4993)
    at blob:http://localhos…6-19b5d5c80288:6740
    at new Fn (blob:http://localhos…6-19b5d5c80288:6757)
    at new Jn (blob:http://localhos…6-19b5d5c80288:7040)
    at blob:http://localhos…6-19b5d5c80288:8992
    at blob:http://localhos…-19b5d5c80288:14153

Sometimes it changes to this:

Uncaught ReferenceError: _typeof is not defined
    at mr (0bcc60f9-25f2-4a56-8906-ebd57645a06c:4993)
    at 0bcc60f9-25f2-4a56-8906-ebd57645a06c:6740
    at new Fn (0bcc60f9-25f2-4a56-8906-ebd57645a06c:6757)
    at new Jn (0bcc60f9-25f2-4a56-8906-ebd57645a06c:7040)
    at 0bcc60f9-25f2-4a56-8906-ebd57645a06c:8992
    at 0bcc60f9-25f2-4a56-8906-ebd57645a06c:14153

I'm on a Rails 6 app with webpack and I have those packages:

"dependencies": {
  "@babel/preset-react": "^7.0.0",
  "@rails/actioncable": "^6.0.0-alpha",
  "@rails/activestorage": "^6.0.0-alpha",
  "@rails/ujs": "^6.0.0-alpha",
  "@rails/webpacker": "^4.0.7",
  "babel-plugin-transform-react-remove-prop-types": "^0.4.24",
  "prop-types": "^15.7.2",
  "react": "^16.9.0",
  "react-dom": "^16.9.0",
  "react-map-gl": "^5.0.10"
}

Do you have any clue of what is happening ?

@adesurirey
Copy link
Author

Solved it thank to this well documented PR: lewagon/rails-templates#81

// config/webpacker/environment.js
const { environment } = require('@rails/webpacker');

// Preventing Babel from transpiling NodeModules packages
environment.loaders.delete('nodeModules');

module.exports = environment;

albertchae added a commit to rubyforgood/freeforest that referenced this issue Apr 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant