Skip to content

[dynamic-plugin-sdk] Plugin fails to load if "eval-source-map" webpack devtool is used #9198

@tetchel

Description

@tetchel

My plugin stopped working when I changed my webpack dev tool to eval-source-map (among a bunch of other things, so it was a lot of effort to debug 😄 )

It is because if you use the eval-source-map devtool (probably others too, this is just the one I happened to be using), webpack inserts a warning comment at the top of the file:

source-map-bug

but the dynamic-plugin-sdk assumes that window.loadPluginEntry is the first line of the file here.

so this results in the plugin ID being inserted at the wrong place (inside the comment, as highlighted in the screenshot above)

The error in the console is Received callback for unknown plugin [object Object],
followed by Entry script for plugin <plugin id> loaded without callback:
image

To compare, here it what it looks like when I switched to the inline-source-map devtool, you can see now the plugin ID is correctly passed as the first argument to loadPluginEntry.

source-map-working

Metadata

Metadata

Assignees

Labels

component/coreRelated to console core functionalitycomponent/sdkRelated to console-plugin-sdkkind/bugCategorizes issue or PR as related to a bug.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions