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

[rush] rush build causes error when running build script #1530

Closed
1 of 2 tasks
sadsa opened this issue Sep 17, 2019 · 4 comments
Closed
1 of 2 tasks

[rush] rush build causes error when running build script #1530

sadsa opened this issue Sep 17, 2019 · 4 comments

Comments

@sadsa
Copy link

sadsa commented Sep 17, 2019

Is this a feature or a bug?

  • Feature
  • Bug

Please describe the actual behavior.

rush build fails with the error Cannot resolve dependency 'stylis-rule-sheet'. The node_modules folder contains a styled-components with its own node_modules and we can see stylis-rule-sheet installed.

Reproduction steps:

  1. Clone the repo
  2. Globally install rush
  3. run rush install and rush build
  4. build will fail showing the following error
3 of 4: [example-app] failed to build!

SKIPPED (3)
================================
my-toolchain
my-controls
my-app
================================

FAILURE (1)
================================
example-app (5.46 seconds)
>>> example-app
parcel build index.html
×  C:\Users\---\Projects\rush-example\apps\example-app\node_modules\styled-components\dist\styled-components.browser.esm.js:2:30: Cannot resolve dependency 'stylis-rule-sheet'
  1 | import Stylis from 'stylis/stylis.min';
> 2 | import _insertRulePlugin from 'stylis-rule-sheet';
    |                              ^
  3 | import React, { cloneElement, createContext, Component, createElement } from 'react';
  4 | import unitless from '@emotion/unitless';
  5 | import { isElement, isValidElementType, ForwardRef } from 'react-is';
================================

[example-app] Returned error code: 1

Error: Project(s) failed to build
rush build - Errors! (5.58 seconds)

What is the expected behavior?

The build script should not encounter any errors. Perhaps this is related with PNPM and #1447

  • Tool: Rush
  • Tool Version: Rush v5.13.0
  • PNPM Version: v3.1.1
  • Node Version: v10.16.1
  • OS: Windows 10
@sadsa
Copy link
Author

sadsa commented Sep 17, 2019

Side note: running npm i styled-components@^4.3.2 and then rush build solves this issue, however I would like to continue using PNPM.

@sadsa
Copy link
Author

sadsa commented Sep 17, 2019

The generated symlink to styled-components seems points to C:\Users\---\Projects\---\arc-mono\common\temp\node_modules\.registry.npmjs.org\styled-components\4.3.2\node_modules\styled-components which contains no node_modules folder.

Image of installation directory can be found here

As you can see there is no node_modules directory

@sadsa
Copy link
Author

sadsa commented Sep 17, 2019

I'm using Parcel as a bundling tool and it seems to be the way modules are being resolved within the parcel-bundler itself.

See:

@sadsa
Copy link
Author

sadsa commented Sep 17, 2019

I can confirm that the PR submitted to Parcel fixes this issue. Closing until Parcel merge the pending PR

@sadsa sadsa closed this as completed Sep 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant