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

Workbench doesn't load when using @microsoft/rush with SPFx 1.8 #3736

Open
NickSevens opened this issue Apr 4, 2019 · 1 comment

Comments

Projects
None yet
3 participants
@NickSevens
Copy link

commented Apr 4, 2019

Category

  • Question
  • Typo
  • Bug
  • Additional article idea

Expected or Desired Behavior

When using @microsoft/rush as monorepo manager, I expect to be able to test my web parts on the local workbench.

Observed Behavior

When using @microsoft/rush as a monorepo manager and adding just a single SPFX 1.8 webpart project, the local workbench does not work. When running gulp serve the build completes and the browser is started, but the page stays blank. There are JS issues showing up:

[1554362242164][SPComponentLoader.loadScript] [SPLoaderError.urlStatusLocalhostFileNotFoundError]:
***Failed to load URL 'https://localhost:4321/../../common/temp/node_modules/@microsoft/decorators/dist/decorators.js' for resource 'decorators' in component 'f97266fb-ccb7-430e-9384-4124d05295d3' (Decorators). The file was not found in the server.
Make sure that you are running 'gulp serve'.

***CALLSTACK:
Error
    at SPLoaderError.SPError [as constructor] (https://localhost:4321/temp/workbench-packages/@microsoft_sp-loader/dist/sp-loader-assembly_default.js:8390:24)
    at new SPLoaderError (https://localhost:4321/temp/workbench-packages/@microsoft_sp-loader/dist/sp-loader-assembly_default.js:4036:28)
    at Function.ErrorBuilder.buildErrorWithErrorLog (https://localhost:4321/temp/workbench-packages/@microsoft_sp-loader/dist/sp-loader-assembly_default.js:3801:21)
    at Function.ErrorBuilder.buildUrlStatusLocalhostFileNotFoundError (https://localhost:4321/temp/workbench-packages/@microsoft_sp-loader/dist/sp-loader-assembly_default.js:3735:21)
    at Function.ResourceUrlChecker._throwUrlStatusError (https://localhost:4321/temp/workbench-packages/@microsoft_sp-loader/dist/sp-loader-assembly_default.js:6119:59)
    at https://localhost:4321/temp/workbench-packages/@microsoft_sp-loader/dist/sp-loader-assembly_default.js:6110:43
    at async Promise.all (index 0)

Judging by the error message, the workbench tries to load from common/temp/node_modules/... which is indeed the path where the node modules are saved by @microsoft/rush. However, the path is not served by the server.

This used to work perfectly in SPFx 1.6/1.7, so I wonder what has changed for SPFx 1.8.

Steps to Reproduce

  • Create a new @microsoft/rush repository: rush init
  • Add an SPFx project (e.g. apps/my-demo-app)
  • Add the project to the rush.json config
  • Run rush update
  • Run rush build
  • Run gulp serve in the apps/my-demo-app directory
@msft-github-bot

This comment has been minimized.

Copy link
Collaborator

commented Apr 4, 2019

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.