I've created a single page app with LWR v0.6.5 and it works great locally. When I upgrade to LWR v0.8.1 and run yarn dev the app returns this error:

[info] Watching: /Users/me/my-app/src/modules/global/header/header.js
Error: dot-dot-slash is not allowed for module specifier
    at getModuleIdentity (file:///Users/me/my-app/node_modules/@lwrjs/shared-utils/build/es/identity.js:288:15)
    at file:///Users/me/my-app/node_modules/@lwrjs/core/build/es/middlewares/api-middleware.js:201:40
    at file:///Users/me/my-app/node_modules/@lwrjs/server/build/es/express/express-server.js:53:19
    at Layer.handle [as handle_request] (/Users/me/my-app/node_modules/express/lib/router/layer.js:95:5)
    at next (/Users/me/my-app/node_modules/express/lib/router/route.js:144:13)
    at Route.dispatch (/Users/me/my-app/node_modules/express/lib/router/route.js:114:3)
    at Layer.handle [as handle_request] (/Users/me/my-app/node_modules/express/lib/router/layer.js:95:5)
    at /Users/me/my-app/node_modules/express/lib/router/index.js:284:15
    at param (/Users/me/my-app/node_modules/express/lib/router/index.js:365:14)
    at param (/Users/me/my-app/node_modules/express/lib/router/index.js:376:14)
[info] Watching: /Users/me/my-app/src/modules/global/header/header.html

Changing versions back to 0.6.5 fixes the error every time. I cloned the LWR repo to modify the imports in question (lwr/server/express) and ran npm link. The dot-dot-slash error went away, but it started throwing this error:

Error: [BABEL] /Users/me/my-app/src/modules/setup/app/app.ts: You gave us a visitor for the node type TSSatisfiesExpression but it's not a valid type
    at verify (/Users/me/lwr/node_modules/@babel/traverse/lib/visitors.js:114:13)
    at Function.explode (/Users/me/lwr/node_modules/@babel/traverse/lib/visitors.js:36:3)
    at /Users/me/lwr/node_modules/@babel/core/lib/config/full.js:296:42
    at Generator.next (<anonymous>)
    at Function.<anonymous> (/Users/me/lwr/node_modules/@babel/core/lib/gensync-utils/async.js:27:3)
    at Generator.next (<anonymous>)
    at evaluateSync (/Users/me/lwr/node_modules/gensync/index.js:251:28)
    at Function.sync (/Users/me/lwr/node_modules/gensync/index.js:89:14)
    at sync (/Users/me/lwr/node_modules/@babel/core/lib/gensync-utils/async.js:78:25)
    at sync (/Users/me/lwr/node_modules/gensync/index.js:182:19)

How can I get the latest version to run the dev server so I don't have to build and restart the server every time I make a change?

  • I assume you have an import somewhere that uses a relative path that includes ../? If so, is this in your code? If so, can you replace it with a host relative path or similar, or move the resource you are referencing to remove the parent navigation?
    – Phil W
    Oct 29, 2022 at 15:09
  • I updated all my paths. It looks like the error is being thrown on LWR itself. There are two "common" modules the LWR version of express imports. As far as I can tell, that is where the issue is. As I mentioned in the post, fixing those imports in LWR fixed the error but created the second error block.
    – Stickel
    Oct 31, 2022 at 16:56


You must log in to answer this question.

Browse other questions tagged .