Skip to content

No code generation entry for runtime main for asset/resource (existing runtimes: main+secondMain) #16879

@janlent1

Description

@janlent1

Bug report

What is the current behavior?
enable css experimental feature.

When we create a common chunkgroup, and have two bigger entrypoints(thats why I added the polyfill, otherwise it wont throw the error), css modules runtime gets somehow merged and throws an error:

No code generation entry for runtime main for asset/resource|/Applications/forks/nativecssissue/nativecssIssue/source_folder/testTheme/BLISSYM.woff (existing runtimes: main+secondMain)

ERROR in ./source_folder/Test.css
No code generation entry for runtime main for asset/resource|/Applications/forks/nativecssissue/nativecssIssue/source_folder/testTheme/BLISSYM.woff (existing runtimes: main+secondMain)
Error: No code generation entry for runtime main for asset/resource|/Applications/forks/nativecssissue/nativecssIssue/source_folder/testTheme/BLISSYM.woff (existing runtimes: main+secondMain)
    at CodeGenerationResults.get (/Applications/forks/nativecssissue/nativecssIssue/node_modules/webpack/lib/CodeGenerationResults.js:62:10)
    at RuntimeTemplate.assetUrl (/Applications/forks/nativecssissue/nativecssIssue/node_modules/webpack/lib/RuntimeTemplate.js:1032:41)
    at CssUrlDependencyTemplate.apply (/Applications/forks/nativecssissue/nativecssIssue/node_modules/webpack/lib/dependencies/CssUrlDependency.js:119:21)
    at handleDependency (/Applications/forks/nativecssissue/nativecssIssue/node_modules/webpack/lib/css/CssGenerator.js:65:13)
    at Array.forEach (<anonymous>)
    at CssGenerator.generate (/Applications/forks/nativecssissue/nativecssIssue/node_modules/webpack/lib/css/CssGenerator.js:67:23)
    at NormalModule.codeGeneration (/Applications/forks/nativecssissue/nativecssIssue/node_modules/webpack/lib/NormalModule.js:1204:22)
    at /Applications/forks/nativecssissue/nativecssIssue/node_modules/webpack/lib/Compilation.js:3329:22
    at /Applications/forks/nativecssissue/nativecssIssue/node_modules/enhanced-resolve/lib/forEachBail.js:16:12
    at /Applications/forks/nativecssissue/nativecssIssue/node_modules/webpack/lib/Cache.js:93:5
    at Hook.eval [as callAsync] (eval at create (/Applications/forks/nativecssissue/nativecssIssue/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)

If the current behavior is a bug, please provide the steps to reproduce.
https://github.com/janlent1/nativecssIssue/tree/runtimebuildissue
use the branch runtimebuildissue

npm run start

What is the expected behavior?
It should create two files per runtime, or accept the two runtimes in one correctly.
If i can help, please point me to the correct code that i should adapt. I tried going through it but i couldn't find the problematic code area.

Other relevant information:
webpack version: 5.76.3
Node.js version: 14.21.1
Operating System: linux
Additional tools:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions