You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run deno task build and observe error in CLI console:
✘ [ERROR] Requires import access to "unpkg.com:443", run again with the --allow-import flag [plugin deno-loader]
islands/Counter.tsx:2:21:
2 │ import * as mod from 'https://unpkg.com/[email protected]/esm/standalone.mjs'
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: Uncaught (in promise) Error: Build failed with 1 error:
islands/Counter.tsx:2:21: ERROR: [plugin: deno-loader] Requires import access to "unpkg.com:443", run again with the --allow-import flag
let error = new Error(text);
^
at failureErrorWithLog (https://deno.land/x/[email protected]/mod.js:1626:15)
at https://deno.land/x/[email protected]/mod.js:1034:25
at runOnEndCallbacks (https://deno.land/x/[email protected]/mod.js:1461:45)
at buildResponseToResult (https://deno.land/x/[email protected]/mod.js:1032:7)
at https://deno.land/x/[email protected]/mod.js:1061:16
at responseCallbacks.<computed> (https://deno.land/x/[email protected]/mod.js:679:9)
at handleIncomingPacket (https://deno.land/x/[email protected]/mod.js:739:9)
at readFromStdout (https://deno.land/x/[email protected]/mod.js:655:7)
at https://deno.land/x/[email protected]/mod.js:1974:11
at eventLoopTick (ext:core/01_core.js:175:7)
I'm not sure where/how this --allow-import flag should be supplied — the build task is already running with -A, which I'd assume would allow imports from anywhere. Changing build to deno run --allow-import=unpkg.com:443,deno.land:443,esm.sh:443,jsr.io:443 -RWEN --allow-run dev.ts build still gives the same error.
The text was updated successfully, but these errors were encountered:
Related: denoland/deno - feat: add --allow-import flag
Similar (but probably not related): #2696
In Deno 2.0.0, esbuild deno-loader refuses to import from unpkg due to lack of
--allow-import
flag when an unpkg library is imported inside an island.I'm not sure if this is a bug in Deno, esbuild deno-loader, or Fresh itself.
Repro:
Bootstrap app with
deno run -A -r https://fresh.deno.dev
Replace content of
islands/Counter.tsx
with the following:Run
deno task build
and observe error in CLI console:I'm not sure where/how this
--allow-import
flag should be supplied — thebuild
task is already running with-A
, which I'd assume would allow imports from anywhere. Changingbuild
todeno run --allow-import=unpkg.com:443,deno.land:443,esm.sh:443,jsr.io:443 -RWEN --allow-run dev.ts build
still gives the same error.The text was updated successfully, but these errors were encountered: