Comments (9)
i just took the repo as is and i did:
$ yarn
$ cd ~/repos/cra-workspaces-poc/apps
create-react-app --scripts-version @f1lt3r/[email protected] app-foo
$ cd ~/repos/cra-workspaces-poc/apps/app-foo
yarn start was ok, but on
$ yarn test
and i got:
` FAIL src/App.test.js
● Test suite failed to run
Cannot find module '@project/comp-one' from 'App.js'
2 | import logo from './logo.svg';
3 | import './App.css';
> 4 | import CompOne from '@project/comp-one';
| ^
5 |
6 | class App extends Component {
7 | render() {
at Resolver.resolveModule (../../node_modules/jest-resolve/build/index.js:221:17)
at Object.<anonymous> (src/App.js:4:1)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 1.427s
Ran all test suites.
Watch Usage
› Press f to run only failed tests.
› Press o to only run tests related to changed files.
› Press q to quit watch mode.
› Press t to filter by a test name regex pattern.
› Press p to filter by a filename regex pattern.
› Press Enter to trigger a test run.`
from react-workspaces-playground.
That suggestion fixed it for me. Thank you for the help!
from react-workspaces-playground.
How are you running the tests?
from react-workspaces-playground.
I have experienced the same behaviour both with my own monorepo and a clone of this one.
from react-workspaces-playground.
@F1LT3R this is a really big hurdle to me using this approach on my codebase. Is there anything I can do to help fix it?
from react-workspaces-playground.
Should be working now @Remimstr @pastor3llo you want to checkout and test?
from react-workspaces-playground.
Unfortunately no, it's still not working. I did exactly the steps as you outlined for a new repo:
git clone [email protected]:react-workspaces/cra-workspaces-playground.git
cd cra-workspaces-playground
yarn
cd packages/apps/app-one
yarn test
and it still gives the same "Cannot find module '@project/comp-one' from 'App.js' error.
In case it's relevant, I'm using node v11.5.0 yarn v1.15.2 and npm v6.4.1
from react-workspaces-playground.
Working here...
You might need to pull this repo and try that way.
I think following the steps there are parts missing that would make testing work for you.
from react-workspaces-playground.
@Remimstr try adding "main": "src/index.js"
to each package.json
.
from react-workspaces-playground.
Related Issues (20)
- how can i use baseUrl in components HOT 4
- Unknow problem with "path" after successfully compiling HOT 1
- Docker
- ERR! Error: Cannot find module 'react-dev-utils/getPublicUrlOrPath'
- Setting HTTPS=true breaks HMR HOT 1
- How to configure rollup without TypeScript?
- Slack Link is not working
- React Workspace Playground support for MinIO
- Best way for integrating Babel plugins/presets?
- About using create-react-native-app in lerna using workspaces
- package homepage not working
- upgrades to Typescript 4.0.1, Storybook 6.0.21, Yarn 2.2? HOT 1
- Error adding styled-components as a dependency HOT 2
- What's the purpose of this react-workspaces-playground? HOT 1
- Creating a New CRA App doesn't work
- Upgrade to CRA 4 + TS 4 HOT 2
- Does this support Yarn 2? HOT 1
- Storybook help
- Webpack loader issue with Storybook 6 global decorator
- Upgrade React version
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-workspaces-playground.