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.

Can't Find Contract - Symlink Doesn't Work on Windows!

See original GitHub issue

Hello, after the recent commits the react box is not working on windows.

After compiling and running ‘npm run start’ from the client folder I get the following error: (This was not mentioned in the official documentation but in the repository of the new contributor - https://github.com/adrianmcli/truffle-react )

After I ran the client i got this error:

Failed to compile ./src/App.js Module not found: Can't resolve './contracts/SimpleStorage.json' in 'F:\reactBox\client\src'

I understand that the issue is the creation of a symlink and so I tried running the ‘npm run link-contracts:win32’ with no luck.

It gave me an error.

I can confirm that this commit is working properly -> https://github.com/truffle-box/react-box/tree/9fb7ed6c0253c71b574bf160072bc7eb9fdd0336

How can I fix this? And if it can’t be fixed is there a way to use truffle unbox to deploy the above commit directly?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
rori4commented, Sep 12, 2018

OK… after more than 2 hours of digging around here are the issues of the latest commit and how to fix them:

  • On Windows symlink does not work properly so we get an error module not found If you are on windows you need run npm run link-contracts:win32 before running npm run start. However, there is an error in the command in this commit. Replace the command with this: "link-contracts:win32": "cd src && mklink /D contracts ..\\..\\build\\contracts" (the /D was \\D)

  • We have a missing dependency bignumber.js Go inside the client folder and run npm i --production bignumber.js or just add "bignumber.js": "^7.2.1" to the dependencies inside package.json

  • The npm run start does not work The command should be ran from the client folder. The README.md file is out of date.

Hope this helps someone. I don’t know what was so bad with the previous commit that we had to change the whole structure.

0reactions
adrianmclicommented, Dec 22, 2018

Symlink should no longer be required!

This is because we are now using the contracts_build_directory setting here:

contracts_build_directory: path.join(__dirname, "client/src/contracts")

This ensures that the build artifacts are sent to the contracts folder inside the src folder in the React app.

Read more comments on GitHub >

github_iconTop Results From Across the Web

WIndows 10 & symbolic links problems - Super User
Symlinks store actual destination names (so, as long as the other drive is V: on both OSes, it should work). My best guess...
Read more >
Perl - Detecting symbolic links under Windows 10
Given >mklink file_symlink file symbolic link created for file_symlink <<===>> file >mklink /d dir_symlink dir symbolic link created for ...
Read more >
Create symbolic links policy doesn't work - Microsoft Community
After this, I test the policy by going to a command prompt and entering mklink anyfile.tx c:\path\to\any\file.txt and get the result: You do...
Read more >
Symbolic links, why doesn't this work: - Ask Different
1. Of course this one doesn't. · Hmm, now it lets me make the symlink, but the symlink shows the default file icon...
Read more >
The trouble with symbolic links | Hacker News
You can't normally hard link directories. If a file has multiple links, finding them ... A file with multiple links doesn't have an...
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