Title: Dynamic `import` attributes broken with multiple attributes · Issue #50700 · nodejs/node · GitHub
Open Graph Title: Dynamic `import` attributes broken with multiple attributes · Issue #50700 · nodejs/node
X Title: Dynamic `import` attributes broken with multiple attributes · Issue #50700 · nodejs/node
Description: I was trying to adapt a V8 test to run it in Node.js The following version fails in a C++ CHECK (it doesn't matter if the json file exists or not): import assert from 'assert'; var life; import('./modules-skip-1.json', { with: { type: 'j...
Open Graph Description: I was trying to adapt a V8 test to run it in Node.js The following version fails in a C++ CHECK (it doesn't matter if the json file exists or not): import assert from 'assert'; var life; import('./...
X Description: I was trying to adapt a V8 test to run it in Node.js The following version fails in a C++ CHECK (it doesn't matter if the json file exists or not): import assert from 'assert'; var life...
Opengraph URL: https://github.com/nodejs/node/issues/50700
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Dynamic `import` attributes broken with multiple attributes","articleBody":"I was trying to adapt a [V8 test](https://github.com/nodejs/node/blob/main/deps/v8/test/mjsunit/harmony/modules-import-assertions-dynamic-6.mjs) to run it in Node.js\r\n\r\nThe following version fails in a C++ CHECK (it doesn't matter if the json file exists or not):\r\n\r\n```js\r\nimport assert from 'assert';\r\n\r\nvar life;\r\nimport('./modules-skip-1.json', { with: { type: 'json', notARealAssertion: 'value' } }).then(\r\n namespace =\u003e life = namespace.default.life).then(() =\u003e {\r\n assert.strictEqual(life, 42);\r\n });\r\n\r\nvar life2;\r\nimport('./modules-skip-1.json', { with: { 0: 'value', type: 'json' } }).then(\r\n namespace =\u003e life2 = namespace.default.life).then(() =\u003e {\r\n assert.strictEqual(life2, 42);\r\n });\r\n```\r\n\r\n```\r\n#\r\n# Fatal error in , line 0\r\n# Check failed: i \u003c self-\u003elength().\r\n#\r\n#\r\n#\r\n#FailureMessage Object: 0x16d934a68\r\n 1: 0x1025fad74 node::NodePlatform::GetStackTracePrinter()::$_3::__invoke() [/Users/mzasso/.volta/tools/image/node/21.1.0/bin/node]\r\n 2: 0x1036dbcc4 V8_Fatal(char const*, ...) [/Users/mzasso/.volta/tools/image/node/21.1.0/bin/node]\r\n 3: 0x10273d8bc v8::FixedArray::Get(v8::Local\u003cv8::Context\u003e, int) const [/Users/mzasso/.volta/tools/image/node/21.1.0/bin/node]\r\n 4: 0x10255ad78 node::loader::createImportAttributesContainer(node::Environment*, v8::Isolate*, v8::Local\u003cv8::FixedArray\u003e) [/Users/mzasso/.volta/tools/image/node/21.1.0/bin/node]\r\n 5: 0x10255c3d8 node::loader::ImportModuleDynamically(v8::Local\u003cv8::Context\u003e, v8::Local\u003cv8::Data\u003e, v8::Local\u003cv8::Value\u003e, v8::Local\u003cv8::String\u003e, v8::Local\u003cv8::FixedArray\u003e) [/Users/mzasso/.volta/tools/image/node/21.1.0/bin/node]\r\n 6: 0x102895ab0 v8::internal::Isolate::RunHostImportModuleDynamicallyCallback(v8::internal::MaybeHandle\u003cv8::internal::Script\u003e, v8::internal::Handle\u003cv8::internal::Object\u003e, v8::internal::MaybeHandle\u003cv8::internal::Object\u003e) [/Users/mzasso/.volta/tools/image/node/21.1.0/bin/node]\r\n 7: 0x102cc3670 v8::internal::Runtime_DynamicImportCall(int, unsigned long*, v8::internal::Isolate*) [/Users/mzasso/.volta/tools/image/node/21.1.0/bin/node]\r\n 8: 0x103057768 Builtins_CEntry_Return1_ArgvInRegister_NoBuiltinExit [/Users/mzasso/.volta/tools/image/node/21.1.0/bin/node]\r\n```\r\n\r\nThis happens in Node.js 21 and v20.x-staging.","author":{"url":"https://github.com/targos","@type":"Person","name":"targos"},"datePublished":"2023-11-13T10:01:37.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/50700/node/issues/50700"}
| 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:a6244896-0117-4a67-ff10-a05107627259 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D0EC:30006B:BD751:FEFF3:6969A3A1 |
| html-safe-nonce | 00e66d3c7333726812aa0f22dae565d318512d0b8166715a139c0c6d12b7d7a3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMEVDOjMwMDA2QjpCRDc1MTpGRUZGMzo2OTY5QTNBMSIsInZpc2l0b3JfaWQiOiIyOTk3Nzc1NTk1NDIxMTQ4MDY1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 5873115cc6901dbf76152e6c79ffef8cb09ee5472589e767802af16f6715f83f |
| hovercard-subject-tag | issue:1990297880 |
| 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/50700/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f7d87c9d9e48ec9ad8f2d8d6ebcbf14fc6add1bcc10b884c51a54dcbe3488b7a/nodejs/node/issues/50700 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f7d87c9d9e48ec9ad8f2d8d6ebcbf14fc6add1bcc10b884c51a54dcbe3488b7a/nodejs/node/issues/50700 |
| og:image:alt | I was trying to adapt a V8 test to run it in Node.js The following version fails in a C++ CHECK (it doesn't matter if the json file exists or not): import assert from 'assert'; var life; import('./... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | targos |
| hostname | github.com |
| expected-hostname | github.com |
| None | 24c4c97a2d520cb286b35e1a4c22d7a4df3c26a2fa28dd7cdf0e65db327b4de7 |
| 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 | 124667f43168afb6c9c03b7c02eb5b1d2e1be3d9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width