Comments (2)
Second I'm having a problem using the
preact-router.module.js
as is from the dist folder in an ES Modules project that uses eleventy to copy the files fromnode_modules
to another directory
This is not a viable way to use any library with dependencies, unfortunately. Libraries distributed upon NPM do so knowing they can take advantage of the module resolution mechanisms that are built into all modern platforms. This makes them unsuitable for the web.
You'll either want to rebundle your deps yourself (to remove the need for module specifiers altogether) or use one of the many CDNs that have this figured out already. Usually they end up rewriting specifiers, so import ... from 'preact'
becomes import ... from 'https://example-cdn.com/preact'
.
from preact-router.
You will need to change import xyz from "package"
to import xyz from "./package.js"
For example, my router.js file looks like this
from preact-router.
Related Issues (20)
- Router and context question HOT 9
- Preact equivalent of useLocation in react router dom HOT 1
- bug: type conflict in preact-router after preactjs/preact#3747
- Router breaks HMR with @preact/preset-vite
- Links missing a leading slash trigger a page reload
- Can't understand how get typescript work with route params HOT 4
- wrapper or event that can mute Router#1 temporarily HOT 1
- Unwanted css files are shared between multiple routes HOT 1
- TypeScript error "Could not find a declaration file for module preact-router" HOT 2
- Could not find a declaration file for module 'preact-router' HOT 2
- Does not work on Vercel HOT 3
- Accessing the link from the router directly on after Parcel build is not working HOT 1
- Allow URL change but block routing HOT 2
- Typescript type for Match props passed to children
- route() does not routing anywhere HOT 1
- Type definition doesn't allow function to be passed into `<Match />` `children`.
- preact-router not resolving route with params after refresh HOT 1
- Standard Element.matches API overridden on router element HOT 3
- Missing documentation for some functions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from preact-router.