AlexxNB / tinro

Highly declarative, tiny, dependency free router for Svelte's web applications.
MIT License
675 stars 30 forks source link

'Route' is not exported by node_modules #10

Closed ghost closed 4 years ago

ghost commented 4 years ago

Hi, I get such an error. What can be wrong?

rollup v1.32.1 bundles src/main.js → public\build\bundle.js... [!] Error: 'Route' is not exported by node_modules\tinro\dist\tinro.browser.js, imported by src\App.svelte https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module src\App.svelte (6:10) 4: import UserInfo from "./components/UserInfo.svelte"; 5: import Dexie from "dexie"; 6: import {Route} from 'tinro'; ^ 7:

AlexxNB commented 4 years ago

It is intersting - rollup take dist/tinro.browser.js instead cmp/index.js. Could you share your rollup.config.js?

ghost commented 4 years ago

Thanks for the quick response. I already realized that this is due to the rollup plugin '@ rollup / plugin-node-resolve', where there is a setting [browser: true]. If you remove it, then everything goes back to normal. rollup config

ghost commented 4 years ago

Я думаю можно закрывать. Сорри за простой вопрос. Спасибо за божественный роутер, бро))

AlexxNB commented 4 years ago

resolve plugin should be after the svelte plugin because svelte plugin has its own resolver.

Probably I should remove browser build from the package in future versions, can't figure out why it is there.

Всегда, пожалуйста =)