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

Build not working on Windows #498

Closed
1 task done
rahulgawale opened this issue Mar 6, 2024 · 5 comments
Closed
1 task done

Build not working on Windows #498

rahulgawale opened this issue Mar 6, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@rahulgawale
Copy link

rahulgawale commented Mar 6, 2024

Summary

I cloned the project and tried to run the build command without any code changes. The build is failing.

Version Info

  1. OS - Windows 11
  2. Node Version - v18.18.1

Steps To Reproduce

  1. Clone the repo
  2. Run npm install
  3. Run 'npm run build`

Current Behavior

The Build is failing with an error

Expected Behavior

Should build the project successfully

Relevant Log Output

> [email protected] build
> lwr build

[info][build] Building lwr application
[warn][build] Output directory already exists. Previously generated files will not be deleted. If you did not intend to do this, re-run with --clean true
[info][ssg] Static Site Generation
[info][ssg] Reusing existing output directory: C:\Users\Techila Global\Desktop\lwc oss\lwc-recipes-oss\site
[info][ssg] Building routes (this may take some time to complete)
[error] Could not load /1/bundle/esm/l/en-US/bi/0/module/mi/recipe%2FerrorPanel%23templates%5CnoDataIllustration.css%2Fv%2F1_0_0/latest/bundle_recipe_errorPanel_templates
oDataIllustration_css.js (imported by ../../../../../../1/bundle/esm/l/en-US/bi/0/module/mi/recipe%2FerrorPanel%23templates%2FnoDataIllustration.html%2Fv%2F1_0_0/latest/bundle_recipe_errorPanel_templates_noDataIllustration_html.js): Cannot read properties of undefined (reading 'linkedModuleRecord')
TypeError: Could not load /1/bundle/esm/l/en-US/bi/0/module/mi/recipe%2FerrorPanel%23templates%5CnoDataIllustration.css%2Fv%2F1_0_0/latest/bundle_recipe_errorPanel_templates
oDataIllustration_css.js (imported by ../../../../../../1/bundle/esm/l/en-US/bi/0/module/mi/recipe%2FerrorPanel%23templates%2FnoDataIllustration.html%2Fv%2F1_0_0/latest/bundle_recipe_errorPanel_templates_noDataIllustration_html.js): Cannot read properties of undefined (reading 'linkedModuleRecord')
    at Object.load (file:///C:/Users/Techila%20Global/Desktop/lwc%20oss/lwc-recipes-oss/node_modules/@lwrjs/module-bundler/build/es/utils/rollup-esm-bundler-plugin.js:57:39)
    at file:///C:/Users/Techila%20Global/Desktop/lwc%20oss/lwc-recipes-oss/node_modules/rollup/dist/es/shared/rollup.js:22748:40
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  code: 'PLUGIN_ERROR',
  plugin: 'bundle-plugin',
  hook: 'load',
  watchFiles: [Array]
}

Code of Conduct

  • I agree to follow this project's Code of Conduct
@rahulgawale rahulgawale added the bug Something isn't working label Mar 6, 2024
Copy link

github-actions bot commented Mar 6, 2024

Thank you for posting this issue. 🙇🏼‍♂️
We will come back to you shortly.

@adityanaag3
Copy link
Contributor

@rahulgawale Can you try now, please?

@rahulgawale
Copy link
Author

rahulgawale commented Apr 2, 2024

@adityanaag3

I am still getting the same error, but this time error is more descriptive. I think this is related to path resolution in lwr, here is the issue reported - LWR Build is not working in both WSL and Windows #3979


> [email protected] build
> lwr build

[config] peer dependency pwa-kit-runtime was not provided
[info][build] Building lwr application
[info][ssg] Static Site Generation
[info][ssg] Building routes (this may take some time to complete)
[info][ssg] en-US \lwr-info in 27 ms
[error] Failed to get view definition "home"
[error] Could not load /1/bundle/esm/l/en-US/bi/0/module/mi/recipe%2FerrorPanel%23templates%5CnoDataIllustration.css%2Fv%2F1_0_0/latest/bundle_recipe_errorPanel_templates
oDataIllustration_css.js (imported by ../../../../../../1/bundle/esm/l/en-US/bi/0/module/mi/recipe%2FerrorPanel%23templates%2FnoDataIllustration.html%2Fv%2F1_0_0/latest/bundle_recipe_errorPanel_templates_noDataIllustration_html.js): Cannot read properties of undefined (reading 'linkedModuleRecord')
TypeError: Could not load /1/bundle/esm/l/en-US/bi/0/module/mi/recipe%2FerrorPanel%23templates%5CnoDataIllustration.css%2Fv%2F1_0_0/latest/bundle_recipe_errorPanel_templates
oDataIllustration_css.js (imported by ../../../../../../1/bundle/esm/l/en-US/bi/0/module/mi/recipe%2FerrorPanel%23templates%2FnoDataIllustration.html%2Fv%2F1_0_0/latest/bundle_recipe_errorPanel_templates_noDataIllustration_html.js): Cannot read properties of undefined (reading 'linkedModuleRecord')
    at Object.load (file:///C:/Users/Techila%20Global/Desktop/lwc%20oss/lwc-recipes-oss/node_modules/@lwrjs/module-bundler/build/es/utils/rollup-esm-bundler-plugin.js:57:39)
    at file:///C:/Users/Techila%20Global/Desktop/lwc%20oss/lwc-recipes-oss/node_modules/rollup/dist/es/shared/rollup.js:22748:40
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  code: 'PLUGIN_ERROR',
  plugin: 'bundle-plugin',
  hook: 'load',
  watchFiles: [Array]
}
[error] LWR Diagnostic Error: An unexpected error occurred: "Could not load /1/bundle/esm/l/en-US/bi/0/module/mi/recipe%2FerrorPanel%23templates%5CnoDataIllustration.css%2Fv%2F1_0_0/latest/bundle_recipe_errorPanel_templates
oDataIllustration_css.js (imported by ../../../../../../1/bundle/esm/l/en-US/bi/0/module/mi/recipe%2FerrorPanel%23templates%2FnoDataIllustration.html%2Fv%2F1_0_0/latest/bundle_recipe_errorPanel_templates_noDataIllustration_html.js): Cannot read properties of undefined (reading 'linkedModuleRecord')"

[error] {
  '0': {
    description: {
      category: 'lwrServer/fatal',
      advice: [],
      message: 'An unexpected error occurred: "Could%20not%20load%20/1/bundle/esm/l/en-US/bi/0/module/mi/recipe%252FerrorPanel%2523templates%255CnoDataIllustration.css%252Fv%252F1_0_0/latest/bundle_recipe_errorPanel_templates%0AoDataIllustration_css.js%20%28imported%20by%20../../../../../../1/bundle/esm/l/en-US/bi/0/module/mi/recipe%252FerrorPanel%2523templates%252FnoDataIllustration.html%252Fv%252F1_0_0/latest/bundle_recipe_errorPanel_templates_noDataIllustration_html.js%29%3A%20Cannot%20read%20properties%20of%20undefined%20%28reading%20%27linkedModuleRecord%27%29"'
    }
  },
  length: 1
}
[error] ServerError: An unexpected error occurred: "Could not load /1/bundle/esm/l/en-US/bi/0/module/mi/recipe%2FerrorPanel%23templates%5CnoDataIllustration.css%2Fv%2F1_0_0/latest/bundle_recipe_errorPanel_templates
oDataIllustration_css.js (imported by ../../../../../../1/bundle/esm/l/en-US/bi/0/module/mi/recipe%2FerrorPanel%23templates%2FnoDataIllustration.html%2Fv%2F1_0_0/latest/bundle_recipe_errorPanel_templates_noDataIllustration_html.js): Cannot read properties of undefined (reading 'linkedModuleRecord')"

    at createSingleDiagnosticError (file:///C:/Users/Techila Global/Desktop/lwc oss/lwc-recipes-oss/node_modules/@lwrjs/diagnostics/build/es/errors.js:6:12)
    at LwrViewRegistry.getViewDefinition (file:///C:/Users/Techila Global/Desktop/lwc oss/lwc-recipes-oss/node_modules/@lwrjs/view-registry/build/es/index.js:230:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async LwrViewHandler.getDefaultRouteViewDefinition (file:///C:/Users/Techila Global/Desktop/lwc oss/lwc-recipes-oss/node_modules/@lwrjs/view-registry/build/es/view-handler.js:123:32)
    at async LwrViewHandler.getViewContent (file:///C:/Users/Techila Global/Desktop/lwc oss/lwc-recipes-oss/node_modules/@lwrjs/view-registry/build/es/view-handler.js:40:32)
    at async file:///C:/Users/Techila Global/Desktop/lwc oss/lwc-recipes-oss/node_modules/@lwrjs/core/build/es/middleware/view-middleware.js:45:28
    at async file:///C:/Users/Techila Global/Desktop/lwc oss/lwc-recipes-oss/node_modules/@lwrjs/core/build/es/middleware/utils/error-handling.js:16:13
    at async file:///C:/Users/Techila Global/Desktop/lwc oss/lwc-recipes-oss/node_modules/@lwrjs/server/build/es/fs/fs-server.js:61:13
    at async file:///C:/Users/Techila Global/Desktop/lwc oss/lwc-recipes-oss/node_modules/@lwrjs/core/build/es/middleware/locale-middleware.js:7:9
    at async file:///C:/Users/Techila Global/Desktop/lwc oss/lwc-recipes-oss/node_modules/@lwrjs/server/build/es/fs/fs-server.js:47:13
    at async file:///C:/Users/Techila Global/Desktop/lwc oss/lwc-recipes-oss/node_modules/@lwrjs/core/build/es/middleware/request-processor-middleware.js:63:9
    at async file:///C:/Users/Techila Global/Desktop/lwc oss/lwc-recipes-oss/node_modules/@lwrjs/server/build/es/fs/fs-server.js:47:13
    at async LwrFsKoa.dispatchUrl (file:///C:/Users/Techila Global/Desktop/lwc oss/lwc-recipes-oss/node_modules/@lwrjs/server/build/es/fs/fs-server.js:25:9)
    at async SiteGenerator.dispatchResourceRecursive (file:///C:/Users/Techila Global/Desktop/lwc oss/lwc-recipes-oss/node_modules/@lwrjs/core/build/es/tools/static-generation.js:166:23)  
    at async SiteGenerator.generateRoute (file:///C:/Users/Techila Global/Desktop/lwc oss/lwc-recipes-oss/node_modules/@lwrjs/core/build/es/tools/static-generation.js:129:13)
    at async SiteGenerator.generateRoutesForLocale (file:///C:/Users/Techila Global/Desktop/lwc oss/lwc-recipes-oss/node_modules/@lwrjs/core/build/es/tools/static-generation.js:89:13)     
    at async SiteGenerator.generateRoutes (file:///C:/Users/Techila Global/Desktop/lwc oss/lwc-recipes-oss/node_modules/@lwrjs/core/build/es/tools/static-generation.js:67:13)
    at async SiteGenerator.buildStaticApplication (file:///C:/Users/Techila Global/Desktop/lwc oss/lwc-recipes-oss/node_modules/@lwrjs/core/build/es/tools/static-generation.js:44:9)       
    at async generateStaticSite (file:///C:/Users/Techila Global/Desktop/lwc oss/lwc-recipes-oss/node_modules/@lwrjs/core/build/es/index.js:196:5)
    at async Command.<anonymous> (file:///C:/Users/Techila Global/Desktop/lwc oss/lwc-recipes-oss/node_modules/lwr/build/es/cli/commands/build.js:68:13)
[info][ssg] en-US \ in 4422 ms
[info][ssg] Static Site Generation complete in 5 seconds

@adityanaag3
Copy link
Contributor

Cool. From this recipes repo standpoint, despite the errors, the build completes successfully, and the site is generated. You should be able to run the site locally.

@rahulgawale
Copy link
Author

Thanks @adityanaag3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants