parcel-bundler / parcel

The zero configuration build tool for the web. 📦🚀
https://parceljs.org
MIT License
43.46k stars 2.27k forks source link

Parcel fails build on import of data uri #6795

Open AlexMoutonNoble opened 3 years ago

AlexMoutonNoble commented 3 years ago

🐛 bug report

On some meandering with Parcel I ended up trying to bundle the 'avajs' test framework. Somewhere in their code they have a function to seemingly check the current operation of es6 modules and do so with:

import("data:text/javascript,0");

This fails the parcel build with

@parcel/core: Unknown pipeline: data.

I see code from v1 that seemed to exclude data:/mailto:/tel: in urls but it doesnt look like theres any such guard in the pipelines?

I tried to configure a pipeline for this but couldn't see how to configure a null loader.

Thanks A

🎛 Configuration (.babelrc, package.json, cli command)

A brand new package.json with this one import in index.js then yarn run parcel index.js

🌍 Your Environment

Software Version(s)
Parcel rc0
Node
npm/Yarn
Operating System
AlexMoutonNoble commented 3 years ago

Looking at this more its not guaranteed in any spec that the import call can accept a URI. so I think this is not a bug.

AlexMoutonNoble commented 3 years ago

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#dynamic_imports

mischnic commented 3 years ago

Not sure if the spec says so explicitly, but all browsers do support this.