sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

adding mobx to spfx React web part breaks build

Open dgusoff opened this issue 7 years ago • 3 comments

Category

  • [ ] Question
  • [ ] Typo
  • [x ] Bug
  • [ ] Additional article idea

After scaffolding a new spfx web part with react and adding mobx integrations, bundle fails with errors thrown from files in node_modules.

Expected or Desired Behavior

gulp bundle should succeed after adding reference to observable in code

Observed Behavior

gulp bundle exits in failure. Exact text can be found here:

Steps to Reproduce

Two ways:

  1. clone this repo and run npm install and gulp serve --nobrowser

or

    • scaffold a new spfx web part using react
    • npm install mobx mobx-react
    • add import {observable} from 'mobx'; to any typescript file
    • gulp serve or gulp bundle

generator version is 1.7.1 node version is 8.12.0

I'm sure it has to be some sort of dependency collision but wasn't able to figure it out after a few hours of head scratching.

dgusoff avatar Jan 03 '19 14:01 dgusoff

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

msft-github-bot avatar Jan 03 '19 14:01 msft-github-bot

I was able to get this working with the help of a colleague. Later versions of mobx do not seem to play well with spfx.

Here's the fix: npm install --save-dev [email protected] [email protected]

dgusoff avatar Jan 03 '19 15:01 dgusoff

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

msft-github-bot avatar Jan 25 '20 12:01 msft-github-bot