-
Notifications
You must be signed in to change notification settings - Fork 8
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
Error resolving path import specifiers #16
Comments
I went and added some tests to look at resolution of relative paths, including the specific case of resolving a relative path to a file that doesn't exist https://github.com/Polymer/koa-node-resolve/blob/resolve-module-specifier-for-file-without-imports-and-exports/src/test/resolve-node-specifier.test.ts#L84 which is the only case I could concoct where that error would come up. Is there any chance that in your case the The node resolution algorithm actually can't ignore relative paths because of the way node module resolution algorithm still has to transform relative path specifiers by adding missing file extensions, for example. |
I also added tests to verify this wasn't some issue with missing import/export specifiers in |
It looks like specifically when resolving either packages or relative paths in HTML from a URL with no subpath (e.g. e.g. server.ts:
index.html (being served from
I believe this is due to a combination of these two lines:
Afaict this is not a problem when the |
@kevinpschaaf I am having trouble reproducing this issue. Can you provide a repro? Is it worth mentioning that in your example, the script tag doesn't have |
I just added unit to |
Thanks, @kevinpschaaf I have a PR to fix this now in review #30 |
The middleware appears to be trying to resolve import specifiers that are already paths, and erroring that it cannot resolve them. It should be ignoring them altogether:
The text was updated successfully, but these errors were encountered: