[Resolved] Using modules without transforms


#1

Please take a look at https://lit-lazy-image.glitch.me/

It’s giving me a browser error: SyntaxError: import declarations may only appear at top level of a module

Project console reads:

Error { SyntaxError: Unexpected token, expected ";" (82:16)

    at Parser.raise (/rbd/pnpm-volume/37d414a6-559f-4446-8ece-17089dad3c01/node_modules/.registry.npmjs.org/babylon/7.0.0-beta.47/node_modules/babylon/lib/index.js:776:15)

    at Parser.unexpected (/rbd/pnpm-volume/37d414a6-559f-4446-8ece-17089dad3c01/node_modules/.registry.npmjs.org/babylon/7.0.0-beta.47/node_modules/babylon/lib/index.js:2079:16)

    at Parser.semicolon (/rbd/pnpm-volume/37d414a6-559f-4446-8ece-17089dad3c01/node_modules/.registry.npmjs.org/babylon/7.0.0-beta.47/node_modules/babylon/lib/index.js:2063:40)

    at Parser.parseExpressionStatement (/rbd/pnpm-volume/37d414a6-559f-4446-8ece-17089dad3c01/node_modules/.registry.npmjs.org/babylon/7.0.0-beta.47/node_modules/babylon/lib/index.js:4482:10)

    at Parser.parseStatementContent (/rbd/pnpm-volume/37d414a6-559f-4446-8ece-17089dad3c01/node_modules/.registry.npmjs.org/babylon/7.0.0-beta.47/node_modules/babylon/lib/index.js:4081:19)

    at Parser.parseStatement (/rbd/pnpm-volume/37d414a6-559f-4446-8ece-17089dad3c01/node_modules/.registry.npmjs.org/babylon/7.0.0-beta.47/node_modules/babylon/lib/index.js:3962:17)

    at Parser.parseBlockOrModuleBlockBody (/rbd/pnpm-volume/37d414a6-559f-4446-8ece-17089dad3c01/node_modules/.registry.npmjs.org/babylon/7.0.0-beta.47/node_modules/babylon/lib/index.js:4513:23)

    at Parser.parseBlockBody (/rbd/pnpm-volume/37d414a6-559f-4446-8ece-17089dad3c01/node_modules/.registry.npmjs.org/babylon/7.0.0-beta.47/node_modules/babylon/lib/index.js:4500:10)

    at Parser.parseBlock (/rbd/pnpm-volume/37d414a6-559f-4446-8ece-17089dad3c01/node_modules/.registry.npmjs.org/babylon/7.0.0-beta.47/node_modules/babylon/lib/index.js:4489:10)

    at Parser.parseFunctionBody (/rbd/pnpm-volume/37d414a6-559f-4446-8ece-17089dad3c01/node_modules/.registry.npmjs.org/babylon/7.0.0-beta.47/node_modules/babylon/lib/index.js:3754:24) pos: 1735, loc: Position { line: 82, column: 16 } }

But there’s only one instance of the word ‘import’ in my project, and it’s the first line of my module :confused:

Do I need to set some babylon config or something? Is there an option not to apply any transforms at all?


#2

I see
Uncaught (in promise) TypeError: this.options.templateFactory is not a function

in the console. Whatever that means. :confused:


#3

The bittersweet truth is that upgrading some deps made both errors disappear

:man_shrugging: