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

Couldn't find preset "env" relative to directory #418

Closed
3 tasks done
hacdias opened this issue Jan 19, 2018 · 1 comment
Closed
3 tasks done

Couldn't find preset "env" relative to directory #418

hacdias opened this issue Jan 19, 2018 · 1 comment

Comments

@hacdias
Copy link

hacdias commented Jan 19, 2018

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Please describe your issue:

When using no linked dependency, everything works flawlessly. When using a linked dependency (after running yarn link {insert package} I get the following error:

Uncaught Error: Couldn't find preset "env" relative to directory "D:\\Code\\ipfs-shipyard\\ipfs-react-components\\dist"
    at D:\Code\ipfs-shipyard\ipfs-desktop\node_modules\babel-core\lib\transformation\file\options\option-manager.js:293:19
    at Array.map (native)
    at OptionManager.resolvePresets (D:\Code\ipfs-shipyard\ipfs-desktop\node_modules\babel-core\lib\transformation\file\options\option-manager.js:275:20)
    at OptionManager.mergePresets (D:\Code\ipfs-shipyard\ipfs-desktop\node_modules\babel-core\lib\transformation\file\options\option-manager.js:264:10)
    at OptionManager.mergeOptions (D:\Code\ipfs-shipyard\ipfs-desktop\node_modules\babel-core\lib\transformation\file\options\option-manager.js:249:14)
    at OptionManager.init (D:\Code\ipfs-shipyard\ipfs-desktop\node_modules\babel-core\lib\transformation\file\options\option-manager.js:368:12)
    at File.initOptions (D:\Code\ipfs-shipyard\ipfs-desktop\node_modules\babel-core\lib\transformation\file\index.js:212:65)
    at new File (D:\Code\ipfs-shipyard\ipfs-desktop\node_modules\babel-core\lib\transformation\file\index.js:135:24)
    at Pipeline.transform (D:\Code\ipfs-shipyard\ipfs-desktop\node_modules\babel-core\lib\transformation\pipeline.js:46:16)
    at BabelCompiler.compileSync (D:\Code\ipfs-shipyard\ipfs-desktop\node_modules\electron-compilers\lib\js\babel.js:81:26)

Console output when you run electron-forge with the environment variable DEBUG=electron-forge:*. (Instructions on how to do so here). Please include the stack trace if one exists.

PS D:\Code\ipfs-shipyard\ipfs-desktop> yarn start
yarn run v1.3.2
$ electron-forge start
WARNING: DEBUG environment variable detected.  Progress indicators will be sent over electron-forge:lifecycle
  electron-forge:lifecycle Process Started: Checking your system +0ms
  electron-forge:lifecycle Process Succeeded: Checking your system +936ms
  electron-forge:runtime-config setting key: verbose to value: false +0ms
WARNING: DEBUG environment variable detected.  Progress indicators will be sent over electron-forge:lifecycle
  electron-forge:lifecycle Process Started: Locating Application +0ms
  electron-forge:project-resolver searching for project in: D:\Code\ipfs-shipyard\ipfs-desktop +0ms
  electron-forge:project-resolver electron-forge compatible package.json found in D:\Code\ipfs-shipyard\ipfs-desktop\package.json +9ms
  electron-forge:lifecycle Process Succeeded: Locating Application +15ms
  electron-forge:lifecycle Process Started: Preparing native dependencies +11ms
  electron-forge:lifecycle Process Succeeded: Preparing native dependencies +1s
  electron-forge:hook could not find hook: generateAssets +0ms
  electron-forge:lifecycle Process Started: Launching Application +9ms
  electron-forge:lifecycle Process Succeeded: Launching Application +7ms

What command line arguments are you passing?

None.

What does your config.forge data in package.json look like?

"make_targets": {
        "win32": [
          "squirrel"
        ],
        "darwin": [
          "dmg"
        ],
        "linux": [
          "deb",
          "rpm"
        ]
      },
      "electronPackagerConfig": {
        "packageManager": "yarn",
        "executableName": "ipfs-desktop",
        "icon": "./src/img/icons/executable/ipfs.ico"
      },
      "electronInstallerDebian": {
        "icon": "./src/img/icons/executable/ipfs.ico",
        "scripts": {
          "postinst": "postinst.sh"
        }
      },
      "electronWinstallerConfig": {
        "name": "Desktop",
        "setupIcon": "./src/img/icons/executable/ipfs.ico",
        "loadingGif": "./src/img/loading.gif",
        "exe": "ipfs-desktop.exe"
      },
      "electronInstallerDMG": {
        "icon": "./src/img/icons/executable/ipfs.icns"
      },
      "github_repository": {
        "owner": "ipfs-shipyard",
        "name": "ipfs-desktop"
      }
    }

Please provide either a failing minimal testcase (with a link to the code) or detailed steps to
reproduce your problem. Using electron-forge init is a good starting point, if that is not the
source of your problem.

git clone https://github.com/ipfs-shipyard/ipfs-desktop
git clone https://github.com/ipfs-shipyard/ipfs-react-components
cd ipfs-react-components && yarn && yarn link && cd ..
cd ipfs-desktop && yarn && yarn link ipfs-react-components && yarn start

It happens with other linked dependencies too. This is making the development very slow since I always have to deploy the dependency and then update the electron app...

@MarshallOfSound
Copy link
Member

As of electron-forge@6.0.0 we don't use electron-compile by default. If you still experience this issue in a post-6.0.0 world you should raise an issue on electron-compile.

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

2 participants