Skip to content

Docker build : error in 'deps' stage : missing file #264

Closed
@PierreLeresteux

Description

@PierreLeresteux

During the 'deps' stage at the yarn install command, yarn try to run the yarn theme:generate-typing (because of the postinstall script ?).

It failed, because no source has been mounted in the docker context and during this yarn step, it will try to run the chakra-cli tokens ./src/theme/theme.ts so an error occured :

#15 81.92 [5/5] Building fresh packages...
#15 103.8 $ yarn theme:generate-typing
#15 104.0 yarn run v1.22.19
#15 104.0 $ chakra-cli tokens ./src/theme/theme.ts
#15 104.2 
#15 104.2  Chakra UI CLI  v2.1.0 by Chakra UI
#15 104.2 Generate theme typings for autocomplete
#15 104.2 
#15 104.2 
#15 104.3 - Generating chakra theme typings
#15 104.5 ✖ An error occurred
#15 104.5 Error: ENOENT: no such file or directory, stat '/app/src/theme'
#15 104.5 Error: ENOENT: no such file or directory, stat '/app/src/theme'
#15 104.5     at Object.statSync (node:fs:1551:3)
#15 104.5     at resolveConfigPath (/app/node_modules/tsconfig-paths/lib/tsconfig-loader.js:55:12)
#15 104.5     at loadSyncDefault (/app/node_modules/tsconfig-paths/lib/tsconfig-loader.js:32:22)
#15 104.5     at tsConfigLoader (/app/node_modules/tsconfig-paths/lib/tsconfig-loader.js:26:22)
#15 104.5     at configLoader (/app/node_modules/tsconfig-paths/lib/config-loader.js:30:22)
#15 104.5     at Object.loadConfig (/app/node_modules/tsconfig-paths/lib/config-loader.js:9:12)
#15 104.5     at _callee2$ (/app/node_modules/@chakra-ui/cli/dist/scripts/read-theme-file.worker.js:95:38)
#15 104.5     at tryCatch (/app/node_modules/regenerator-runtime/runtime.js:63:40)
#15 104.5     at Generator.invoke [as _invoke] (/app/node_modules/regenerator-runtime/runtime.js:294:22)
#15 104.5     at Generator.next (/app/node_modules/regenerator-runtime/runtime.js:119:21)
#15 104.5 error Command failed with exit code 1.
#15 104.5 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
#15 104.6 error Command failed with exit code 1.
#15 104.6 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
------
executor failed running [/bin/sh -c yarn install --frozen-lockfile]: exit code: 1

One possible fix is to add, at least, the src/theme folder in the docker context before the yarn install, but I'm not a node expert, so I don't know if it's the best fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions