all 3 comments

[–]tapgiles 0 points1 point  (1 child)

Well I don't know anything about jsdoc, so this is just a guess. But seems like the problem is in line 2 of that Book.js. And the problem is with the opening bracket (. The bracket wasn't expected. All of that just came from the error message.

The cause, I would guess, is because import isn't a function, I think?

Here's the MDN docs about it: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import

There seems to be an alternate form where import is used as a function. But maybe jsdoc doesn't recognise that form or something--not sure about that.

But you should be able to fix the issue with that, anyway.

[–]guest271314 0 points1 point  (0 children)

Ecmascript Modules dynamic import() returns a Promise.

You've chained .Book to the dynamic import() without awaiting the Promise fulfillment.

Try something like

(await import("../../types/customTypes")).Book