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 using html-bundler-webpack-plugin #5971

Open
webdiscus opened this issue Mar 19, 2024 · 1 comment · May be fixed by #6607
Open

[Bug]: Error using html-bundler-webpack-plugin #5971

webdiscus opened this issue Mar 19, 2024 · 1 comment · May be fixed by #6607
Labels
bug Something isn't working stale

Comments

@webdiscus
Copy link

webdiscus commented Mar 19, 2024

System Info

System:
OS: macOS 14.4
CPU: (10) arm64 Apple M1 Max
Memory: 790.63 MB / 64.00 GB
Binaries:
Node: 18.18.2
npm: 9.8.1

Details

RSPack and HTML Bundler

A symbiosis of the fast RSPack and the powerful html-bundler-webpack-plugin could be a Vite killer.
This plugin is an advanced successor to html-webpack-plugin.

But currently RSPack v0.5.8 is yet not 100% compatible with the Webpack.

Using the html-bundler-webpack-plugin with RSPack occurs the issue:

/Users/xxxx/html-bundler-webpack-plugin/experiments/rspack/node_modules/@rspack/core/dist/Compiler.js:518
    __classPrivateFieldSet(this, _Compiler_instance, new instanceBinding.Rspack(rawOptions, this.builtinPlugins, {
                                                     ^

Error: Failed to convert JavaScript value `function filenameFn(..) ` into rust type `String`

    at Compiler._Compiler_getInstance (/Users/xxxx/html-bundler-webpack-plugin/experiments/rspack/node_modules/@rspack/core/dist/Compiler.js:518:54)
    at Compiler.build (/Users/xxxx/html-bundler-webpack-plugin/experiments/rspack/node_modules/@rspack/core/dist/Compiler.js:384:87)
    at /Users/xxxx/html-bundler-webpack-plugin/experiments/rspack/node_modules/@rspack/core/dist/Watching.js:263:23
    at Hook.eval [as callAsync] (eval at create (/Users/xxxx/html-bundler-webpack-plugin/experiments/rspack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:24:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/xxxx/html-bundler-webpack-plugin/experiments/rspack/node_modules/tapable/lib/Hook.js:18:14)
    at Watching._Watching_go (/Users/xxxx/html-bundler-webpack-plugin/experiments/rspack/node_modules/@rspack/core/dist/Watching.js:253:34)
    at Watching._Watching_invalidate (/Users/xxxx/html-bundler-webpack-plugin/experiments/rspack/node_modules/@rspack/core/dist/Watching.js:217:74)
    at /Users/xxxx/html-bundler-webpack-plugin/experiments/rspack/node_modules/@rspack/core/dist/Watching.js:51:94
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11) {
  code: 'GenericFailure'
}

The filename property of an entry object can be string or function (pathData, assetInfo) => string.
See please the Webpack documentation for the filename.

There is very simple rspack.config.js:

const path = require('path');
const HtmlBundlerPlugin = require('html-bundler-webpack-plugin');

module.exports = {
  output: {
    path: path.join(__dirname, 'dist/'),
    publicPath: '',
  },

  entry: {},

  plugins: [
    new HtmlBundlerPlugin({
      entry: {
        index: './src/template.html',
      },
    }),
  ],
};

Note

The HTML Bundler Plugin works fine with Webpack and has over 96% test coverage.

P.S.
The reference to original issue is RSPack support and compatibility

Reproduce link

https://github.com/webdiscus/html-bundler-webpack-plugin/tree/master/experiments/rspack

Reproduce Steps

clone https://github.com/webdiscus/html-bundler-webpack-plugin.git
cd html-bundler-webpack-plugin/experiments/rspack
npm i
npm run dev
@webdiscus webdiscus added bug Something isn't working pending triage The issue/PR is currently untouched. labels Mar 19, 2024
@h-a-n-a h-a-n-a removed the pending triage The issue/PR is currently untouched. label Mar 21, 2024
Copy link

stale bot commented May 20, 2024

This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

@stale stale bot added the stale label May 20, 2024
@9aoy 9aoy linked a pull request May 22, 2024 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants