Skip to content
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

[Bug]: Error [ERR_INTERNAL_ASSERTION]: This is caused by either a bug in Node.js or incorrect usage of Node.js internals. #8399

Open
nexusprime-here opened this issue Nov 11, 2024 · 0 comments
Labels
bug Something isn't working pending triage The issue/PR is currently untouched.

Comments

@nexusprime-here
Copy link

System Info

System:
OS: Windows 11 10.0.22631
CPU: (12) x64 Intel(R) Core(TM) i5-10400 CPU @ 2.90GHz
Memory: 6.82 GB / 15.83 GB
Binaries:
Node: 22.8.0 - C:\Program Files\nodejs\node.EXE
npm: 10.8.3 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Chromium (128.0.2739.79)
Internet Explorer: 11.0.22621.3527
npmPackages:
@rspack/cli: ^1.1.0 => 1.1.0
@rspack/core: ^1.0.8 => 1.1.0

Details

Error [ERR_INTERNAL_ASSERTION]: This is caused by either a bug in Node.js or incorrect usage of Node.js internals.
Please open an issue with this stack trace at https://github.com/nodejs/node/issues

at assert (node:internal/assert:14:11)
at ModuleLoader.getModuleJobForRequire (node:internal/modules/esm/loader:329:5)
at new ModuleJobSync (node:internal/modules/esm/module_job:313:34)
at ModuleLoader.importSyncForRequire (node:internal/modules/esm/loader:314:11)
at loadESMFromCJS (node:internal/modules/cjs/loader:1381:24)
at Module._compile (node:internal/modules/cjs/loader:1503:5)
at Module._extensions..js (node:internal/modules/cjs/loader:1691:10)
at Module.load (node:internal/modules/cjs/loader:1317:32)
at Module._load (node:internal/modules/cjs/loader:1127:12)
at TracingChannel.traceSync (node:diagnostics_channel:315:14) {

code: 'ERR_INTERNAL_ASSERTION'
}

// rspack.config.js
import { join as j } from 'path';
import { BannerPlugin } from '@rspack/core';

const cwd = process.cwd();

/** @type {import('@rspack/core').Configuration} */
const config = {
    mode: 'production',
    entry: j(cwd, 'src', 'cli.ts'),
    output: {
        path: j(cwd, 'dist'),
        filename: 'cli.js',
    },
    module: {
        rules: [
            {
                test: /\.ts$/,
                use: 'ts-loader'
            }
        ]
    },
    target: 'node',
    resolve: {
        extensions: ['.ts', '.js']
    },
    externals: [
        './comptime/build',
        './comptime/execute',
        './config',
    ],
    externalsType: 'commonjs',
    plugins: [
        new BannerPlugin({
            banner: '#!/usr/bin/env node',
            raw: true
        })
    ]
}

export default config;

Reproduce link

No response

Reproduce Steps

  1. use config
  2. run ./node_modules/.bin/rspack build
@nexusprime-here nexusprime-here added bug Something isn't working pending triage The issue/PR is currently untouched. labels Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending triage The issue/PR is currently untouched.
Projects
None yet
Development

No branches or pull requests

1 participant