-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Relative imports in package submodules not working #8
Comments
Hi ! I got the same errors when trying to import I think the problem appeared not so long ago as the same code used to work for me a week ago. |
Haha that was you! I actually saw those errors in our error logs, to the point that I tried to reproduce but couldn't. Does this work on your machine?
Also, what version of deno are you using, are you using the latest? |
I was using Deno 1.0.1. I just tried to launch the same script using Deno 1.0.0: it works. So the bug appears to come from Deno 1.0.1. Thank you for your answers anyway ! |
Oh no! Please file an issue with Deno then, that only means more people will see it until a fix is out |
Yep, will do 👍 |
FWIW, I believe the original issue described here is not related to Deno. (Apologies for providing an example with that). Chrome 81: Importing the package import('https://cdn.pika.dev/numcodecs@0.0.15').then(console.log)
// Promise {<pending>}
// Module {…} But importing a submodule import('https://cdn.pika.dev/numcodecs@0.0.15/zlib').then(console.log)
// Promise {<pending>}
// zlib:1 GET https://cdn.pika.dev/-/numcodecs@v0.0.15-oPpSeQ9e1lBFNcvr53yE/dist=es2019,mode=exports/index-4ac424c6.mjs net::ERR_ABORTED 404
// Uncaught (in promise) TypeError: Failed to fetch dynamically imported module: https://cdn.pika.dev/numcodecs@0.0.15/zlib |
Ah gotcha. Yup, deep imports are not supported at the moment, but support is coming soon. In the mean time, we only support the main package import for most packages |
Thank you for the clarification. Looking forward to when that lands! Would be happy to help. |
Hi! Coming from denoland/deno#5696 I found following:
That gives resolved URL to types: https://cdn.pika.dev/-/html5parser@v1.1.2-0fAkC9viFOtRB3VnrC0m/dist=es2019,mode=types/index.d.ts Contents of above type declaration: /*!
*
* Copyright 2017 - acrazing
*
* @author acrazing joking.young@gmail.com
* @since 2017-08-19 01:09:54
* @version 1.0.0
* @desc index.ts
*/
export * from './walk.d.ts';
export * from './types.d.ts';
export * from './parse.d.ts';
export * from './tokenize.d.ts';
export * from './utils.d.ts'; which resolve to following URLs:
Unfortunately all of them yield HTTP 404. Hope this helps. CC @FredKSchott |
If this is not a Deno bug, how come importing the exact same lib works when using Deno 1.0.0-rc3 and not when using Deno 1.0.1 ? |
Ha! I just found the culprit; definitely Deno bug, sorry for noise. |
np, thanks for the quick fix! |
Hi! I am working on package that I've bundled with multiple entry points via rollup, and listed these entrypoints as submodules in my
package.json
. Some of these submodules share an import (thanks to code-splitting with rollup), but relative imports seem to fail for the submodules! I'd really like to use pika to load these modules dynamically in an application!I closed #2 as the original description did not describe the problem well.
The text was updated successfully, but these errors were encountered: