Title: Better error message for invalid directory import · Issue #33219 · nodejs/node · GitHub
Open Graph Title: Better error message for invalid directory import · Issue #33219 · nodejs/node
X Title: Better error message for invalid directory import · Issue #33219 · nodejs/node
Description: The following test case was brought up by @addaleax esm.mjs: import mod from './'; console.log(mod); where node esm.mjs fails with TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension "" for /tmp/test/ at Loader.defaultGetForma...
Open Graph Description: The following test case was brought up by @addaleax esm.mjs: import mod from './'; console.log(mod); where node esm.mjs fails with TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension "" ...
X Description: The following test case was brought up by @addaleax esm.mjs: import mod from './'; console.log(mod); where node esm.mjs fails with TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file exten...
Opengraph URL: https://github.com/nodejs/node/issues/33219
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Better error message for invalid directory import","articleBody":"The following test case was brought up by @addaleax \r\n\r\nesm.mjs:\r\n\r\n```js\r\nimport mod from './';\r\n\r\nconsole.log(mod);\r\n```\r\n\r\nwhere `node esm.mjs` fails with\r\n\r\n```\r\nTypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension \"\" for /tmp/test/\r\n at Loader.defaultGetFormat [as _getFormat] (internal/modules/esm/get_format.js:65:15)\r\n```\r\n\r\nWe should ensure the error message here provides the correct steps to resolve the issue.","author":{"url":"https://github.com/guybedford","@type":"Person","name":"guybedford"},"datePublished":"2020-05-03T08:08:29Z","url":"https://github.com/nodejs/node/issues/33219"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1dd8fa17-de0b-99ff-28fc-54a83b18738b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 812A:254A2:A446D2:DB0888:6AED3386 |
| html-safe-nonce | 4482b772bb4b52781889e5c80b498041a6a9bab1205ac1bcf0c0a3f61b474526 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MTJBOjI1NEEyOkE0NDZEMjpEQjA4ODg6NkFFRDMzODYiLCJ2aXNpdG9yX2lkIjoiODUwMDM2NTcxODAxMDU0MDkzNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3b3a0178dfe36c0b46039af0a35170ca14d884ac972366085fab44a34e8ea841 |
| hovercard-subject-tag | issue:611358443 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/33219/issue_layout |
| twitter:image | https://opengraph.githubassets.com/32ce0148d98c01f7abca7f155c27e89f9b4577d921a081bc859b55cd345c5ac2/nodejs/node/issues/33219 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/32ce0148d98c01f7abca7f155c27e89f9b4577d921a081bc859b55cd345c5ac2/nodejs/node/issues/33219 |
| og:image:alt | The following test case was brought up by @addaleax esm.mjs: import mod from './'; console.log(mod); where node esm.mjs fails with TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension "" ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | guybedford |
| hostname | github.com |
| expected-hostname | github.com |
| None | e51d0b7b5ab34b1688c05b54c3ed17b8658b2fa9bca973a9c740683ccb12cf4a |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 59ebb7b901cc154ecc179a44f266fcf69f343b30 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width