You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been running my app with npm start and don't get any error in my command line as well as browser console. When I run npm run serve I get a Hash history needs a DOM error:
Build [================== ] 91% (18.5s) additional asset processing
Total precache size is about 395 kB for 21 resources.
(undefined) Template execution failed: Invariant Violation: Hash history needs a DOM
(undefined) Error: Invariant Violation: Hash history needs a DOM
npm ERR! Darwin 16.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "serve"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] serve: preact build && preact serve
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] serve script 'preact build && preact serve'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the AyePWA package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! preact build && preact serve
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs AyePWA
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls AyePWA
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/nephix/Development/preact/Aye/repository/AyePWA/npm-debug.log
I'm using HashRouter from react-router-dom in my App Component:
import { h, Component } from 'preact';
import { HashRouter, Route } from 'react-router-dom';
import Order from '../routes/order';
import Login from '../routes/login';
import OrderLocation from '../routes/order_location';
import Item from '../routes/item';
export default class App extends Component {
render() {
return (
<div id="app">
<HashRouter>
<div>
<main>
<Route exact path="/" component={Order} />
<Route path="/order/location" component={OrderLocation} />
<Route path="/login" component={Login} />
<Route path="/item/:index" component={Item} />
</main>
</div>
</HashRouter>
</div>
);
}
}
(simplified version)
I'm posting this in preact-cli because the error seems to come during the production build process, while the development build process works fine. I'm not sure exactly what the error is. Has anybody encountered a similar problem and knows a workaround? Thanks guys
The text was updated successfully, but these errors were encountered:
Hi,
I've been running my app with
npm start
and don't get any error in my command line as well as browser console. When I runnpm run serve
I get a Hash history needs a DOM error:My dependencies are:
I'm using HashRouter from react-router-dom in my App Component:
(simplified version)
I'm posting this in preact-cli because the error seems to come during the production build process, while the development build process works fine. I'm not sure exactly what the error is. Has anybody encountered a similar problem and knows a workaround? Thanks guys
The text was updated successfully, but these errors were encountered: