You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having an issue processing a certain package with this plugin, namely stream-chat
It seems they do not have a default export, which means it requires to be imported in this way:
import{StreamChat}from'stream-chat';
And I don't know how to translate that to webpack-cdn-plugin. I don't seem to get it to work. According to the doc, var need to be specified – otherwise stream-chat breaks as it's not a valid variable name.
external_"stream-chat":1 Uncaught ReferenceError: stream is not defined
From this code:
/*!******************************!*\
!*** external "stream-chat" ***!
\******************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("module.exports = stream-chat;\n\n//# sourceURL=webpack:///external_%22stream-chat%22?");
I tried setting it with 'var': 'StreamChat', which seems to pass the previous error, but then it fails with another error:
I believe the issue is because the package do not export itself properly, and I would like to report the issue with the project, but I don't know how to phrase it. Any help to understand what's needed would be appreciated
The text was updated successfully, but these errors were encountered:
Thanks for reporting, I might have two available options you can try to see if it works.
Find a way to import the cjs version of the package instead of the es version, with the cjs the default is always available, it will be a single object with all the exported module.
Create a bridge repo and publish to npm e.g. export {StreamChat as default} from 'stream-chat'
Other than that, I'm not sure any way around it as I haven't touched the codebase for a while and might be missing something.
I'm having an issue processing a certain package with this plugin, namely
stream-chat
It seems they do not have a default export, which means it requires to be imported in this way:
And I don't know how to translate that to
webpack-cdn-plugin
. I don't seem to get it to work. According to the doc,var
need to be specified – otherwisestream-chat
breaks as it's not a valid variable name.From this code:
I tried setting it with
'var': 'StreamChat'
, which seems to pass the previous error, but then it fails with another error:When it tries to replace
StreamChat
in the code with:I believe the issue is because the package do not export itself properly, and I would like to report the issue with the project, but I don't know how to phrase it. Any help to understand what's needed would be appreciated
The text was updated successfully, but these errors were encountered: