ITADN

Bug: createRequire broken in 0.8.0-beta+

#1407Closedkyubisation 创建于 2026-02-20
bug
K
kyubisationcommented
Sorry I didn't notice this earlier. Previously with 0.7.0-beta the following code was working, but with 0.8.0-beta+ it throws the error "TypeError: not a function" ```js import { createRequire } from "node:module"; var __require = createRequire(import.meta.url); console.log(__require('node:fs')); console.log(__require('node:events')); ``` ### Reproduction 1. Create file test.js with above content 2. Run `llrt test.js` ### Workaround Replace `createRequire(import.meta.url)` with `require`. (Minor side note, unrelated to this issue, the release 0.8.1-beta still prints 0.8.0-beta if called with `--version`.)
关闭于 2026-02-21 2 条评论