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

Unexpected token HashRouter. #163

Open
philderbeast opened this issue Jun 20, 2020 · 9 comments
Open

Unexpected token HashRouter. #163

philderbeast opened this issue Jun 20, 2020 · 9 comments

Comments

@philderbeast
Copy link

I followed the steps for local development from the readme and saw the following error.

> npm i
> npx bower i
> npx pulp build
> npm start
...
* Building project in /.../purescript-lumi-components
ℹ 「wds」: Project is running at http://0.0.0.0:3000/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from /.../purescript-lumi-components
✖ 「wdm」:    33 modules

ERROR in ./docs/index.jsx 8:2
Module parse failed: Unexpected token (8:2)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file.
See https://webpack.js.org/concepts#loaders
|
| ReactDOM.render(
>   <HashRouter>
|     <ScrollManager>
|       <App />
ℹ 「wdm」: Failed to compile.
           Src   Lib   All
Warnings   0     0     0
Errors     0     0     0
* Build successful.
@megamaddu
Copy link
Member

Hmm, I just tried a fresh clone and didn't run into this. Perhaps an issue with npm's cache? If clearing that doesn't help can you provide more info like your OS, npx pulp --version, node --version, npm --version, and npm ls webpack?

@philderbeast
Copy link
Author

Verifying the cache as npm suggests.

> npm cache clean
npm ERR! As of npm@5, the npm cache self-heals from corruption issues and data extracted from the cache is
guaranteed to be valid. If you want to make sure everything is consistent, use 'npm cache verify' instead. On the
other hand, if you're debugging an issue with the installer, you can use `npm install --cache /tmp/empty-cache`
to use a temporary cache instead of nuking the actual one.
npm ERR!
npm ERR! If you're sure you want to delete the entire cache, rerun this command with --force.

> npm cache verify
Cache verified and compressed (~/.npm/_cacache):
Content verified: 4830 (315827706 bytes)
Index entries: 7316
Finished in 6.21s

Here are the versions while I try forcing a clean of the cache.

> npx pulp --version
Pulp version 13.0.0
purs version 0.13.6 using /.../purescript-lumi-components/node_modules/.bin/purs

> node --version
v14.4.0

> npm ls webpack
[email protected] /Users/pdejoux/dev/src/increase/purescript-lumi-components
└── [email protected]

@philderbeast
Copy link
Author

After npm cache clean --force the build reports the same error as before.

@megamaddu
Copy link
Member

Very strange.. 🤔

@megamaddu
Copy link
Member

[:~/dev/lumi/purescript-lumi-components] main 31s 130 ±
> npx pulp --version
Pulp version 13.0.0
purs version 0.13.6 using /Users/maddie/dev/lumi/purescript-lumi-components/node_modules/.bin/purs

[:~/dev/lumi/purescript-lumi-components] main ±
> npm ls webpack
[email protected] /Users/maddie/dev/lumi/purescript-lumi-components
└── [email protected]


[:~/dev/lumi/purescript-lumi-components] main 2s ±
> npm --version
6.14.5

[:~/dev/lumi/purescript-lumi-components] main ±
> node --version
v14.3.0

@megamaddu
Copy link
Member

@philderbeast
Copy link
Author

It works for me now with that one line taken out. Thanks @spicydonuts.

@philderbeast
Copy link
Author

I did a fresh clone and this time didn't encounter the error. I see the line I commented out last time for the build has not changed but I have now installed bower, pulp, purescript and spago globally. I did this to try other projects without such hermetic builds as this one.

@megamaddu
Copy link
Member

Odd. I was using the npx commands so we should have been on the same local versions. I don't get why excluding unrelated folders affects whether docs/ is included 🤔

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

2 participants