| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
@nodejs/modules |
Sorry, something went wrong.
There was a problem hiding this comment.
Just my 2¢. Not sure that error code has been used for this purpose historically.
Sorry, something went wrong.
|
CC: @ljharb since this mentions MIME to user |
Sorry, something went wrong.
|
to clarify a bit, these should have been picked up and could have been generated in the past |
Sorry, something went wrong.
|
Seems fine to me, since anyone using a data URL is already familiar with MIMEs (this is ofc not true for almost every other specifier category). |
Sorry, something went wrong.
|
Ping @nodejs/modules for reviews. |
Sorry, something went wrong.
There was a problem hiding this comment.
Aside from my outstanding comments (non-blocking), everything else looks pretty good to me.
I will be digging around this part of codebase in a few days, so I will report back if I find issues.
Sorry, something went wrong.
There was a problem hiding this comment.
Perhaps Unsupported MIME "text/plain" loading "data:text/plain,export default 0".
Also it could be nice if we could support the parent context for tracing where it comes from eg if it were import('data:...') in a module, it helps to know where the import expression is.
Sorry, something went wrong.
|
@guybedford Agreed, although I think this would deserve its own PR to align with other ERR_INVALID_MODULE_SPECIFIER uses in core. |
Sorry, something went wrong.
Sorry, something went wrong.
|
@aduh95 I do think it's important to move the "unsupported MIME" part to the beginning of the message though. This is because the data URL could be of any length, so that when scanning the error the user should be able to easily see the "unsupported MIME" part first. It also fixes that the current error isn't quite gramatically complete without a comma or colon or something type of break otherwise. Alternatively to make it gramatically correct:
|
Sorry, something went wrong.
Sorry, something went wrong.
|
I went to the last suggestion as it was the easiest to implement. I think you have a point regarding very long specifiers occulting the reason, maybe we can fix that in a similar way as proposed in #37852 (comment)? |
Sorry, something went wrong.
I believe the feature request outlined in #37581 is precisely the error property we need. |
Sorry, something went wrong.
Sorry, something went wrong.
Fixes: nodejs#37647 PR-URL: nodejs#37701 Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is> Reviewed-By: Guy Bedford <guybedford@gmail.com>
| Back | FazBrowse Home | New Git URL |
Fixes: #37647
Changes the error message when importing module with an unknown/unsupported MIME type from:
to