Error Importing modal js


Topic: Error Importing modal js

Alexandroni asked 4 years ago

Expected behavior I'm trying to use the modal of mdb5 but I can import the module. It appears the error: Uncaught SyntaxError: import declarations may only appear at top level of a module

Actual behavior

Resources (screenshots, code snippets etc.) https://mdbootstrap.com/snippets/standard/alexandroni/3072874


Dawid Wajszczuk staff answered 4 years ago

Hi,

Try replacing <script type="text/javascript"> with <script type="module">. Also change src="js/mdb.min.js to something like src="./js/mdb.min.js or whatever is an appropriate path to this file.

Keep coding,
Dawid


Alexandroni answered 4 years ago

You must use de mdb object instead of bootstrap object


FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Closed

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: MDB Standard
  • MDB Version: MDB5 3.5.1
  • Device: pc
  • Browser: firefox
  • OS: windows
  • Provided sample code: No
  • Provided link: Yes
Tags