1

getting error while integrating bundle.js, and i used "script-loader" in but no use. libraries used vuejs, vuex, ssr, vuetify, webpack.js

Error:

  build.js:1 Uncaught ReferenceError: module is not defined
  at build.js:1 .   
1
  • Did you find a solution for this? Commented Aug 25, 2021 at 10:56

1 Answer 1

1

change script from

  <script src="/dist/build.js"></script>

to

  <script nomodule src="/dist/build.js"></script>

add nomodule attribute in script tag, its happen because we used libraryTarget: 'commonjs2' in webpack config

finally my index.html will be like

<!doctype html>
 <html lang="en">
  <head>

  </head>
 <body>


   <script nomodule src="/dist/build.js"></script>


</body>
</html>

Note:

do not make any changes in src attribute
Sign up to request clarification or add additional context in comments.

1 Comment

this solution doesn't work. No errors in console, but code also doesn't load

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.