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
  • Loading branch information
albertchae committed Apr 5, 2020
1 parent 5c9ef27 commit c478919
Show file tree
Hide file tree
Showing 4 changed files with 7 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
4 changes: 3 additions & 1 deletion app/javascript/packs/home/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from "react";
import ReactDOM from "react-dom";
import Map from "./components/map";
import "mapbox-gl/dist/mapbox-gl.css";
import ReactMapGL from "react-map-gl";

const ALAMEDA = {
type: "Feature",
Expand Down Expand Up @@ -39,9 +40,10 @@ 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 c478919

Please sign in to comment.