Parcel: Parcel 2: 馃悰Import image via url: scheme

Created on 7 Mar 2020  路  2Comments  路  Source: parcel-bundler/parcel

馃悰 bug report

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"
  }

Most helpful comment

Lol

All 2 comments

Have you tried removing the space after url: ?

Lol

Was this page helpful?
0 / 5 - 0 ratings

Related issues

devongovett picture devongovett  路  3Comments

davidnagli picture davidnagli  路  3Comments

dotdash picture dotdash  路  3Comments

Niggler picture Niggler  路  3Comments

algebraic-brain picture algebraic-brain  路  3Comments