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

TypeError: __webpack_require__ is not a function in uml plugin also #1643

Closed
ats1999 opened this issue Jul 6, 2021 · 1 comment
Closed
Labels
Milestone

Comments

@ats1999
Copy link
Contributor

ats1999 commented Jul 6, 2021

Describe the bug

Getting TypeError: __webpack_require__ is not a function while importing uml plugin.

TypeError: __webpack_require__ is not a function
(anonymous function)
node_modules/@toast-ui/editor-plugin-uml/dist/toastui-editor-plugin-uml.js:51
  48 | });
  49 | 
  50 | ;// CONCATENATED MODULE: external "plantuml-encoder"
> 51 | var external_plantuml_encoder_namespaceObject = require("plantuml-encoder");;
  52 | var external_plantuml_encoder_default = /*#__PURE__*/__webpack_require__.n(external_plantuml_encoder_namespaceObject);
  53 | ;// CONCATENATED MODULE: ./src/index.ts
  54 | /**

Desktop (please complete the following information):

  • OS: Ubuntu 20.04 LTS
  • Browser: Brave

Additional context

I am getting this error while importing uml plugin in Reactjs. This is comeing when i am using developing this locally. When i run it into code-sandbox, then it worked find.

Sandbox

https://codesandbox.io/s/still-night-0feor?file=/src/App.js:2207-2214

The above sandbox is working fine, but when i run the same code locally then i am getting error.

Github Repo

https://github.com/ats1999/react-do/blob/main/src/App.js

@ats1999 ats1999 added the Bug label Jul 6, 2021
@ats1999 ats1999 changed the title TypeError: __webpack_require__ is not a function TypeError: __webpack_require__ is not a function in uml plugin also Jul 6, 2021
@js87zz js87zz added this to the v3.0.1 milestone Jul 7, 2021
@js87zz
Copy link
Contributor

js87zz commented Jul 7, 2021

@ats1999
It was a compatibility issue between version 4 and version 5 of the webpack to handle external modules. I can resolve the issue by changing the bundle format(cjs => umd).

I was able to fix it quickly because it was easily reproduced in your project. Thank you :)

  • released plugins
    • @toast-ui/editor-plugin-uml@3.0.1
    • @toast-ui/editor-plugin-chart@3.0.1
    • @toast-ui/editor-plugin-color-syntax@3.0.1

@js87zz js87zz closed this as completed Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants