history icon indicating copy to clipboard operation
history copied to clipboard

Using the history package in any form causes Svelte apps to die with "uncaught reference error"

Open clearfram3 opened this issue 3 years ago • 1 comments

In my svelte app I have tried all forms of imports from the History package, but they always make the app die with

Uncaught ReferenceError: process is not defined
    at browser.js:1
    at main.js:3

I have tried importing the package both ways:

import history from 'history/browser';
import { createBrowserHistory } from 'history';

Neither works. Any idea what might be causing this?

clearfram3 avatar Mar 19 '21 04:03 clearfram3

In my svelte app I have tried all forms of imports from the History package, but they always make the app die with

Uncaught ReferenceError: process is not defined
    at browser.js:1
    at main.js:3

I have tried importing the package both ways:

import history from 'history/browser';
import { createBrowserHistory } from 'history';

Neither works. Any idea what might be causing this?

type=module will not set global varible,

window.history = createBrowserHistory()

will work

lifeike avatar Sep 25 '21 08:09 lifeike