Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Could not determine component name from file path" when compiling a module for SSR #4555

Closed
lpomerleau opened this issue Sep 17, 2024 · 1 comment

Comments

@lpomerleau
Copy link

Description

Steps to Reproduce

See lwc#2400 here.

In this PR, we are integrating the @lwc/ssr-compiler into LWR-Node for TD-0205202. We started passing TransformOptions.targetSSR = true into @lwc/compiler#transformSync.

  1. Clone the lwr repo
  2. Checkout the laura/ssr-compiler branch
  3. yarn (install + build)
  4. yarn ssr:start
  5. Visit http://localhost:4000

Expected Results

The LWC modules are compiled for SSR.

Actual Results

The @lwc/ssr-compiler cannot parse the filename passed to it:

[error] LWR Diagnostic Error: An unexpected error occurred: "Could not determine component name from file path: /Users/lpomerleau/git/lwr/packages/test-apps/lwr-ssr-app/src/modules/demo/localeSelector/localeSelector.ts"

Error is being thrown here.

Browsers Affected

Node.js

Version

Node project
package.json
"peerDependencies": { "@lwc/compiler": ">= 2.x" }
"devDependencies": { "@lwc/compiler": "7.2.6" }

  • LWC: 7.2.6

Possible Solution

Is LWR-Node passing in a bad filename? We pass the same filenames to the @lwc/compiler, but maybe the SSR compiler has different requirements.

@nolanlawson
Copy link
Collaborator

Fixed by #4567, see also this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants