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

Including react in ApplicationCustomizer #2192

Closed
1 of 4 tasks
sparkitect opened this issue Jul 6, 2018 · 4 comments
Closed
1 of 4 tasks

Including react in ApplicationCustomizer #2192

sparkitect opened this issue Jul 6, 2018 · 4 comments
Labels
area:spfx Category: SharePoint Framework (not extensions related) status:answered Answer to a question.

Comments

@sparkitect
Copy link
Contributor

Category

  • Question
  • Typo
  • Bug
  • Additional article idea

Expected or Desired Behavior

Expect no errors when executing gulp package-solution --ship
Note that other gulp tasks execute without error.

Observed Behavior

Following errors when executing gulp package-solution --ship
[18:43:03] Starting subtask 'package-solution'... [18:43:03] [package-solution] Ignoring manifest due to validation error: (/usr/app/spfx/temp/deploy/37e57283-39f3-4cd0-a31c-2083dcf0607a.json) use '--verbose' for more information [18:43:03] [package-solution] (#/) Data does not match any schemas from 'oneOf' (#/) Missing required property: description (#/loaderConfig) Data does not match any schemas from 'oneOf' (#/loaderConfig/scriptResources/react-dom) Data does not match any schemas from 'oneOf' (#/scriptResources/react-dom/version) Data does not match any schemas from 'oneOf' (#/version) String is too short (0 chars), minimum 5 (#/version) No enum match for: (#/scriptResources/react-dom) Missing required property: path (#/scriptResources/react-dom) Missing required property: defaultPath (#/loaderConfig) Expected type null but found type object (#/componentType) No enum match for: Extension (#/) Missing required property: preconfiguredEntries (#/) Missing required property: items (#/) Missing required property: rootComponentId

@VesaJuvonen
Copy link
Contributor

This indicates that you have a reference on old json files... with different versions which are being used. We would need to understand what versions of SPFx is being used in the package as this is not getting reproduces with you create a clean package from SPFx 1.5.1. Can you confirm what's the status with a clean solution and what versions you are using? Thx.

@sparkitect
Copy link
Contributor Author

sparkitect commented Jul 13, 2018

Using SPFx 1.5.0 in this case.

We are using React in a placeholder and since the Yeoman SharePoint Generator doesn't offer to add a framework when creating an Application Customizer, we had to add it ourselves. It seems two developers did it differently and package[-lock].json was incorrect. Suffice it to say, npm insall react gave us v16 of React while SPFx still needs v15 or something to that effect. Specifying the version of React while doing npm install seems to have fixed it.

Is there official documentation (or even tips) on the correct procedure to add React to an existing project?

@andrewconnell
Copy link
Collaborator

@sparkitect No... not that I'm aware of... but all that's required is to add the two React packages to the package.json's dependencies section (React & React-DOM) & two packages tot he devDependencies section (the equivalent TypeScript type declarations).

Which package versions to use for each of the 4? Create a react web part project using the version of SPFx that you're currently using and inspect package.json for what's supported by SPFx.

@andrewconnell andrewconnell added area:spfx Category: SharePoint Framework (not extensions related) status:answered Answer to a question. and removed status:waiting-for-clarification labels Jan 15, 2019
@msft-github-bot
Copy link
Collaborator

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

@SharePoint SharePoint locked as resolved and limited conversation to collaborators Jan 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area:spfx Category: SharePoint Framework (not extensions related) status:answered Answer to a question.
Projects
None yet
Development

No branches or pull requests

4 participants