Skip to content

Commit

Permalink
Fix _typeof is not defined error by deleting nodeModules from webpack…
Browse files Browse the repository at this point in the history
…er loaders

Manually set height of map div to get something visible for now

More context:
visgl/react-map-gl#874
lewagon/rails-templates#81
mapbox/mapbox-gl-js#3422
  • Loading branch information
albertchae committed Apr 5, 2020
1 parent 5c9ef27 commit d41e437
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/javascript/packs/home/components/map.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ function Map(props) {
onViewportChange={setViewport}
mapboxApiAccessToken={MAPBOX_TOKEN}
onHover={onHover}
height={500}
>
<Pins data={props.location} />

Expand Down
2 changes: 1 addition & 1 deletion app/javascript/packs/home/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const ME_LOCATION = [

document.addEventListener("DOMContentLoaded", () => {
ReactDOM.render(
<div>Hello, world</div>,
<Map location={ME_LOCATION} features={FEATURES} className='freeforestmap' />,
document.body.appendChild(document.createElement("div"))
);
});
4 changes: 3 additions & 1 deletion config/webpack/environment.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const { environment } = require('@rails/webpacker')

module.exports = environment
environment.loaders.delete('nodeModules');

module.exports = environment;
1 change: 0 additions & 1 deletion config/webpacker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ default: &default
development:
<<: *default
compile: true
devtools: "sourcemap"

# Verifies that correct packages and versions are installed by inspecting package.json, yarn.lock, and node_modules
check_yarn_integrity: true
Expand Down

0 comments on commit d41e437

Please sign in to comment.