question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Following CONTRIBUTING.md guidelines doesn't build correctly when running in watch mode

See original GitHub issue

Before opening, please confirm:

JavaScript Framework

Not applicable

Amplify APIs

Not applicable

Amplify Categories

Not applicable

Environment information

# Put output below this line

  System:
    OS: macOS 11.5.1
    CPU: (8) x64 Intel(R) Core(TM) i7-8559U CPU @ 2.70GHz
    Memory: 3.66 GB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.15.5 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 6.14.14 - /usr/local/bin/npm
  npmPackages:
    @babel/cli: ^7.0.0 => 7.14.8
    @babel/core: ^7.0.0 => 7.15.0 (7.9.0, 7.9.0, 7.9.0, 7.9.0, 7.12.9, 7.9.0, 7.9.0, 7.9.0, 7.12.9)
    @babel/preset-env: ^7.0.0 => 7.15.0 (7.3.4, 7.9.0)
    @babel/preset-react: ^7.0.0 => 7.14.5 (7.9.1)
    @types/blob-util:  1.3.3
    @types/bluebird:  3.5.29
    @types/chai:  4.2.7
    @types/chai-jquery:  1.1.40
    @types/jest: ^24.0.18 => 24.9.1
    @types/jquery:  3.3.31
    @types/lodash:  4.14.149
    @types/minimatch:  3.0.3
    @types/mocha:  5.2.7
    @types/node: ^8.9.5 => 8.10.66 (16.6.0, 16.6.0, 16.6.0, 16.6.0, 16.6.0, 16.6.0)
    @types/puppeteer: 1.3.0 => 1.3.0
    @types/sinon:  7.5.1
    @types/sinon-chai:  3.2.3
    babel-loader: ^8.0.0 => 8.2.2 (8.1.0)
    bundlewatch: ^0.3.1 => 0.3.2
    codecov: ^3.6.5 => 3.8.3
    compression-webpack-plugin: ^1.1.3 => 1.1.12
    cypress: ^3.2.0 => 3.8.3
    husky: ^3.0.5 => 3.1.0
    jest: ^24.x.x => 24.9.0
    jest-config: 24.8.0 => 24.8.0 (24.9.0, 24.9.0)
    json-loader: ^0.5.7 => 0.5.7
    lerna: ^3.13.1 => 3.22.1
    prettier: ^1.19.0 => 1.19.1
    pretty-quick: ^1.11.1 => 1.11.1
    rimraf: ^2.6.2 => 2.7.1 (2.6.3, 2.2.8)
    rollup: ^0.67.4 => 0.67.4
    rollup-plugin-commonjs: ^9.2.0 => 9.3.4
    rollup-plugin-json: ^3.1.0 => 3.1.0
    rollup-plugin-node-resolve: ^4.0.0 => 4.2.4
    rollup-plugin-sourcemaps: ^0.4.2 => 0.4.2
    rollup-plugin-typescript: ^1.0.0 => 1.0.1
    source-map-loader: ^0.2.1 => 0.2.4
    ts-jest: ^24.x.x => 24.3.0
    tslint: ^5.7.0 => 5.20.1
    tslint-config-airbnb: ^5.8.0 => 5.11.2
    typedoc: ^0.16.9 => 0.16.11
    typescript: ~3.7.7 => 3.7.7
    uglifyjs-webpack-plugin: ^0.4.6 => 0.4.6
    uuid-validate: ^0.0.3 => 0.0.3
    webpack: ^4.32.0 => 4.46.0
    webpack-bundle-analyzer: ^3.3.2 => 3.9.0
    webpack-cli: ^3.1.0 => 3.3.12
    winston: ^3.2.1 => 3.3.3
  npmGlobalPackages:
    @aws-amplify/cli: 4.11.0
    @aws-amplify/ui-react: 1.2.8
    expo-cli: 3.21.12
    gatsby-cli: 2.12.7
    generator-serverless-policy: 2.0.0
    npm: 6.14.14
    prettier: 1.19.1
    react-native-cli: 2.0.1
    serve: 11.3.2
    serverless: 1.78.1
    yo: 2.0.5

Describe the bug

I followed the guidelines in CONTRIBUTING.md and run the following

git clone git@github.com:[username]/amplify-js.git
cd amplify-js

yarn
yarn bootstrap

After that I ran

yarn build # Build the whole library
yarn link-all # Make all the packages available to link
yarn build:esm:watch # All packages are building ES6 modules in watch mode

yarn build and yarn link-all worked correctly

Screenshot 2021-08-12 at 10 48 01

Screenshot 2021-08-12 at 10 48 20

But when running yarn build:esm:watch several packages fail because it can’t find some modules. I’m looking specifically at @aws-amplify/ui-react because I’m interested in making a PR for that package.

Currently it throws 58 errors similar to Cannot find module '@aws-amplify/ui-components or Cannot find module '@aws-amplify/ui-components/loader'

Screenshot 2021-08-12 at 11 55 38

Screenshot 2021-08-12 at 11 55 59

Is there an extra step that I’m missing?

Expected behavior

Running amplify packages locally in watch mode should run without errors.

Reproduction steps

git clone git@github.com:[username]/amplify-js.git
cd amplify-js

yarn
yarn bootstrap
yarn build # Build the whole library
yarn link-all # Make all the packages available to link
yarn build:esm:watch # All packages are building ES6 modules in watch mode

Code Snippet

// Put your code below this line.

Log output

// Put your logs below this line


aws-exports.js

No response

Manual configuration

No response

Additional configuration

No response

Mobile Device

No response

Mobile Operating System

No response

Mobile Browser

No response

Mobile Browser Version

No response

Additional information and screenshots

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jagonzalrcommented, Aug 20, 2021

@chrisbonifacio if I do that and run yarn build:esm:watch --scope @aws-amplify/ui-react --stream I get no errors but changing a file inside ui-components doesn’t cause a rebuild on ui-react. Do I need to scope on @aws-amplify/ui-components instead?

What I’m installing on my sample project is aws-amplify and @aws-amplify/ui-react.

If I run yarn build:esm:watch --scope @aws-amplify/ui-components --stream it doesn’t throw errors. Should I do then yarn link @aws-amplify/ui-components in my sample project?

0reactions
github-actions[bot]commented, Sep 18, 2022

This issue has been automatically locked since there hasn’t been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

chapter/CONTRIBUTING.md at main - GitHub
Contributing Code. Consider the following options when you are ready to contribute code. ... Step 2 - Run the App Using Docker Mode...
Read more >
How to Build a CONTRIBUTING.md
Start by reflecting on what to include, and what to invite (in terms of contributions) in your CONTRIBUTING.md. See an example of the...
Read more >
To v5 from v4 - webpack
This guide aims to help you migrating to webpack 5 when using webpack directly. If you are using a higher level tool to...
Read more >
Documentation Style Guide - GitLab Docs
Documentation Style Guide. This document defines the standards for GitLab documentation, including grammar, formatting, word use, and more.
Read more >
Configuration - MkDocs
Guide to all available configuration settings. Introduction . Project settings are configured by default using a YAML configuration file in the project ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found