Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uncaught SyntaxError: Cannot use 'import.meta' outside a module - Nx Monorepo

I created an angular nx monorepo and created two applications. When I start either of them I get the following error:

error-message

I already saw some stackoverflow posts were the answers suggested to just add "type": "module" to package.json. But since it is a monorepo only one package.json is used for all the apps.

microfrontend:

enter image description here

like image 551
Stefan Avatar asked Jan 25 '26 23:01

Stefan


1 Answers

This has been asked already, and the answer is here

You just need to adjust your

module.exports = {
    output: {
        uniqueName: "MyProj",
        publicPath: "auto",
        scriptType: 'text/javascript'
    }

to include scriptType: 'text/javascript'

like image 72
grenobnik Avatar answered Jan 27 '26 14:01

grenobnik



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!