Closed RusseII closed 4 years ago
Sorry, I'll take a look today.
I haven't been actively keeping this up to date in the last month but I'm planning on carrying on maintaining it this month especially knowing someone else is trying to use it
I'm having the same problem identically. cra-template
not found, and yarn start generates the following:
> yarn start
yarn run v1.21.1
$ react-scripts start
Could not find a required file.
Name: popup.html
Searched in: / <root> /public
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Out of curiosity I copied over a cra-template
from create-react-app
and this happened instead:
/ <root> /node_modules/react-browser-extension-scripts/scripts/init.js:153
throw err;
^
Error: ENOENT: no such file or directory, link '/ <root> /gitignore' -> '/ <root> /.gitignore'
at Object.linkSync (fs.js:1035:3)
at tryRenameSync (/ <root> /node_modules/fs-extra/lib/move-sync/index.js:40:12)
at Object.moveSync (/ <root> /node_modules/fs-extra/lib/move-sync/index.js:22:3)
at module.exports (/ <root> /node_modules/react-browser-extension-scripts/scripts/init.js:141:8)
at [eval]:3:14
at Script.runInThisContext (vm.js:116:20)
at Object.runInThisContext (vm.js:306:38)
at Object.<anonymous> ([eval]-wrapper:9:26)
at Module._compile (internal/modules/cjs/loader.js:971:30)
at evalScript (internal/process/execution.js:80:25) {
errno: -2,
syscall: 'link',
code: 'ENOENT',
path: '/ <root> /gitignore',
dest: '/ <root> /.gitignore'
}
Aborting installation.
node has failed.
Deleting generated file... node_modules
Deleting generated file... package.json
Deleting generated file... yarn.lock
Done.
error Command failed.
Exit code: 1
Command: /usr/local/bin/create-react-app
Arguments: composr3 --scripts-version react-browser-extension-scripts
Directory: / <root>
Output:
info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.
Hi, I've unfortunately still not had some free time to look at this yet. I have put time aside to resolve this issue on the weekend. Thank you for any extra info given from anyone in advance
I get the same issue - was very keen to try this out though!
Short update: I've made some headway in debugging the issue. Think I should be able to resolve it and get something out by tomorrow morning.
Thanks for your work, Vasily. Same error here.
I actually tried the same thing as @hholmes, with the same result. Then I manually copied the gitignore file and the installation finished with no error messages. But in reality there was lots of missing files and wouldn't work.
Soooo.... It's not ideal, I'm still looking into this because I've only managed to catch pockets of time. I'm really keen to get this resolved BUT in the meantime if you anyone wants to use this. Temporarily you could:
yarn create-react-app my-browser-extension
at the root of /create-react-extension
. /my-browser-extension
into your projects folder.I just checked ^^ against master and seems to be working fine which makes me think that the npx
generate command from the original Create-React-App repository has changed which is why it's failing to find the template and causing errors.
So I've found the cause and almost have fixed the package to work with CRA V3.3.0
.
The problem was that the main package has refactored the template into seperate packages to give more flexibility for developers: https://github.com/facebook/create-react-app/blob/master/CHANGELOG.md#330-2019-12-04
I am 90% sure I'll get a working version out today. This will mean the npx
command will need updating which I'll do in the docs 🎉
I have published the fixes, updated the readme and tested. It seems to be now working and compatible with CRA V3.3.0+
.
Updated readme command: https://github.com/VasilyShelkov/create-react-extension#quick-overview
To use this package as an example use:
npx create-react-app my-browser-extension --scripts-version react-browser-extension-scripts --template browser-extension
OR
npx create-react-app my-browser-extension --scripts-version react-browser-extension-scripts --template browser-extension-typescript
for the typescript version.
Thanks all for your patience and reporting the issues. Sorry it took longer than I would have liked. I will try to be better in future
Could not locate supplied template: /Users/russell/code/cra-template MacBook-Pro-2:code russell$ cd my-browser-extension MacBook-Pro-2:my-browser-extension russell$ ls node_modules package.json yarn.lock MacBook-Pro-2:my-browser-extension russell$ npm start