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

incompatibility with yarn workspaces #36

Open
zvictor opened this issue Nov 14, 2018 · 4 comments
Open

incompatibility with yarn workspaces #36

zvictor opened this issue Nov 14, 2018 · 4 comments
Labels
bug Something isn't working

Comments

@zvictor
Copy link

zvictor commented Nov 14, 2018

The problem

While using graphpack in a multi projects setup with yarn, the error below is thrown.

As a workaround, the whole project using graphpack can be moved to yarn's nohoist.

The workaround
package.json:

{
  "workspaces": {
    "packages": [
      "applications/**/*"
    ],
    "nohoist": [
      "appname-with-graphpack/**"
    ]
  }
}

The error

 error  in /my-app/node_modules/graphpack/lib/server.js

Module build failed (from /my-app/node_modules/graphpack/node_modules/babel-loader/lib/index.js):
Error: [BABEL] /my-app/node_modules/graphpack/lib/server.js: Cannot find module '@babel/preset-typescript' from '/my-app/applications/appname'
    at Function.module.exports [as sync] (/my-app/node_modules/resolve/lib/sync.js:43:15)
    at resolveStandardizedName (/my-app/node_modules/graphpack/node_modules/@babel/core/lib/config/files/plugins.js:101:31)
    at resolvePreset (/my-app/node_modules/graphpack/node_modules/@babel/core/lib/config/files/plugins.js:58:10)
    at loadPreset (/my-app/node_modules/graphpack/node_modules/@babel/core/lib/config/files/plugins.js:77:20)
    at createDescriptor (/my-app/node_modules/graphpack/node_modules/@babel/core/lib/config/config-descriptors.js:154:9)
    at items.map (/my-app/node_modules/graphpack/node_modules/@babel/core/lib/config/config-descriptors.js:109:50)
    at Array.map (<anonymous>)
    at createDescriptors (/my-app/node_modules/graphpack/node_modules/@babel/core/lib/config/config-descriptors.js:109:29)
    at createPresetDescriptors (/my-app/node_modules/graphpack/node_modules/@babel/core/lib/config/config-descriptors.js:101:10)
    at presets (/my-app/node_modules/graphpack/node_modules/@babel/core/lib/config/config-descriptors.js:47:19)

 @ multi graphpack

/my-app/node_modules/graphpack/bin/graphpack.js:16
        throw Error(error || stats.toJson().errors);
        ^

Error: /my-app/node_modules/graphpack/lib/server.js
Module build failed (from /my-app/node_modules/graphpack/node_modules/babel-loader/lib/index.js):
Error: [BABEL] /my-app/node_modules/graphpack/lib/server.js: Cannot find module '@babel/preset-typescript' from '/my-app/applications/appname'
    at Function.module.exports [as sync] (/my-app/node_modules/resolve/lib/sync.js:43:15)
    at resolveStandardizedName (/my-app/node_modules/graphpack/node_modules/@babel/core/lib/config/files/plugins.js:101:31)
    at resolvePreset (/my-app/node_modules/graphpack/node_modules/@babel/core/lib/config/files/plugins.js:58:10)
    at loadPreset (/my-app/node_modules/graphpack/node_modules/@babel/core/lib/config/files/plugins.js:77:20)
    at createDescriptor (/my-app/node_modules/graphpack/node_modules/@babel/core/lib/config/config-descriptors.js:154:9)
    at items.map (/my-app/node_modules/graphpack/node_modules/@babel/core/lib/config/config-descriptors.js:109:50)
    at Array.map (<anonymous>)
    at createDescriptors (/my-app/node_modules/graphpack/node_modules/@babel/core/lib/config/config-descriptors.js:109:29)
    at createPresetDescriptors (/my-app/node_modules/graphpack/node_modules/@babel/core/lib/config/config-descriptors.js:101:10)
    at presets (/my-app/node_modules/graphpack/node_modules/@babel/core/lib/config/config-descriptors.js:47:19)
 @ multi graphpack index[0]
    at Watching.compiler.watch.once (/my-app/node_modules/graphpack/bin/graphpack.js:16:15)
    at Watching.<anonymous> (/my-app/node_modules/graphpack/node_modules/ramda/src/once.js:34:17)
    at Watching.handler (/my-app/node_modules/graphpack/node_modules/ramda/src/internal/_arity.js:14:19)
    at compiler.hooks.done.callAsync (/my-app/node_modules/graphpack/node_modules/webpack/lib/Watching.js:98:9)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/my-app/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:15:1)
    at AsyncSeriesHook.lazyCompileHook (/my-app/node_modules/tapable/lib/Hook.js:154:20)
    at Watching._done (/my-app/node_modules/graphpack/node_modules/webpack/lib/Watching.js:97:28)
    at onCompiled (/my-app/node_modules/graphpack/node_modules/webpack/lib/Watching.js:47:18)
    at hooks.afterCompile.callAsync.err (/my-app/node_modules/graphpack/node_modules/webpack/lib/Compiler.js:552:14)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/my-app/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:15:1)
error Command failed with exit code 1.
@glennreyes
Copy link
Owner

glennreyes commented Nov 18, 2018

@zvictor Thanks for filing this! Maybe worth to put instructions about nohoist to README.md? WDYT?

@glennreyes glennreyes added the bug Something isn't working label Nov 18, 2018
@zvictor
Copy link
Author

zvictor commented Nov 20, 2018

I was actually hoping that we could figure why @babel/preset-typescript can't be found and fix it in a way that it would work regardless of how we are installing our packages.

Using nohoist should only be needed on legacy projects, and I honestly don't feel comfortable having to make a trade-off right on the first dependency of my new project based on graphpack 😕

@VinSpee
Copy link

VinSpee commented Feb 21, 2019

maybe related, but even with nohoist, I'm getting this issue:

$ graphpack dev
🐠 Using babel.config.js defined in your app root
[BABEL] Note: The code generator has deoptimised the styling of /Users/vincentspeelman/Projects/TED/audacious-project-org/node_modules/graphql-upload/node_modules/busboy/deps/encoding/encoding-indexes.js as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of /Users/vincentspeelman/Projects/TED/audacious-project-org/node_modules/busboy/deps/encoding/encoding-indexes.js as it exceeds the max of 500KB

which eventually runs out of memory.

Any thoughts?

@VinSpee
Copy link

VinSpee commented Feb 21, 2019

I've tried defining my own babel config and tried without one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants