Skip to content

Unexpected token HashRouter. #163

Open
@philderbeast

Description

@philderbeast

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.

Activity

maddie927

maddie927 commented on Jun 22, 2020

@maddie927
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

philderbeast commented on Jun 22, 2020

@philderbeast
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
purescript-lumi-components@0.0.0 /Users/pdejoux/dev/src/increase/purescript-lumi-components
└── webpack@4.39.0
philderbeast

philderbeast commented on Jun 22, 2020

@philderbeast
Author

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

maddie927

maddie927 commented on Jun 22, 2020

@maddie927
Member

Very strange.. 🤔

maddie927

maddie927 commented on Jun 22, 2020

@maddie927
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
purescript-lumi-components@0.0.0 /Users/maddie/dev/lumi/purescript-lumi-components
└── webpack@4.39.0


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

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

philderbeast commented on Jun 25, 2020

@philderbeast
Author

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

philderbeast

philderbeast commented on Jun 26, 2020

@philderbeast
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.

maddie927

maddie927 commented on Jun 26, 2020

@maddie927
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @philderbeast@maddie927

        Issue actions

          Unexpected token HashRouter. · Issue #163 · purescript-react/purescript-lumi-components