Trying to import an image via the url: scheme throws
Side note, the same problem happens with a css file if i wanna just copy it to the dist folder and import it via the url afterwards
auth.tsx
import logoUrl from 'url: ../images/logo.svg'
// ...
export default () => <img src={logoUrl}/>
@parcel/resolver-default: Cannot find module 'url: ../images/logo.svg' from 'C:\dev\oz\packages\web\src\components'
C:\dev\oz\packages\web\src\components\auth.tsx:12:21
11 |
> 12 | import logoUrl from 'url: ../images/logo.svg'
> | ^^^^^^^^^^^^^^^^^^^^^^^^^
13 |
14 | import sociconUrl from '../fonts/socicon.css'
{
"dependencies": {
...
},
"devDependencies": {
"parcel": "^2.0.0-nightly.140",
},
"appModern": "dist/index.html",
"targets": {
"appModern": {
"engines": {
"browsers": ["last 1 chrome version"]
}
}
},
"scripts": {
"dev": "parcel src/index.html"
}
Have you tried removing the space after url: ?
Lol
Most helpful comment
Lol