ActionView::Template::Error (ReferenceError: Map is not defined)
See original GitHub issueActual behavior
while try to update react-rails
from 1.5
to 2.3.4
,
it seems there is a big change, i’ve no idea how to fix these problems.
I don’t think i am the only person.
System configuration
Sprockets or Webpacker version: i just don’t know how to check this
React-Rails version: 2.3.4
Rect_UJS version: i just don’t know how to check this
Rails version: 5.1.4
Ruby version: ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]
Since I user docker-compose
,
Dockerfile: FROM rails:onbuild
- upgrade
rails
to5.1.4
- upgrade
react-rails
to2.3.4
bundle install
- modify the
application.rb
as you mentioned rails g react:install
- add
prerender: true
to my componet - restart my docker container, then get error:
- below is the debug result by
web-console
,maybe some help:
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
ReferenceError: google is not defined - Stack Overflow
I just noticed that in Google Chrome's Javascript console: it gives the following error: [blocked] The page at mypage.com/GoogleMapPage.aspx ran insecure ...
Read more >Import Maps Under the Hood in Rails 7 - AppSignal Blog
Learn how to install JavaScript libraries with import maps and how import maps work under the hood in Rails 7.
Read more >Uncaught ReferenceError: google is not defined | WordPress.org
This seems a dependency issue with Google Maps, are you using the Script Center by any chance? We can add a dependency there...
Read more >How to Dynamically Import JavaScript with Import Maps
You'll export code as a SystemJS build and how to set the import map type to use SystemJS format. By the end of...
Read more >Working with JavaScript in Rails - Rails Edge Guides
Applications using import maps do not need Node.js or Yarn to function. If you plan to use Rails with importmap-rails to manage your...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@oiahoon I had this issue, resolved it by adding babel-polyfill.
Step 1: download https://npm-cdn.herokuapp.com/babel-polyfill@6.26.0/dist/polyfill.min.js (per https://babeljs.io/docs/usage/polyfill/), put it in
vendor/assets/javascripts
Step 2: add to
application.js
or something likevendor/assets/javascripts/vendor.js
if you have it:You don’t have to only use ES6, we prefer ES6 to ES5 but in general ES5 is more compatible with things.
Now I think about it, if you’re using
therubyracer
as the JS runtime, you may need to swap tomini_racer
as mini_racer uses a newer version of Chrome’s LibV8 which may enable ES6 features such as Map.We dropped therubyracer support a few versions back.