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

hotfix about find the custom template path. #8878

Closed

Conversation

ricardoamedeiros
Copy link

Hi,
It is a pleasure to contribute to the community and to the fantastic ReactJS framework.

This correct is about the issue #8425 and #8844 . In issue #8425 I detail the problem and the applied solution.

@facebook-github-bot
Copy link

Hi @ricardoamedeiros!

Thank you for your pull request and welcome to our community.We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file.

In order for us to review and merge your code, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@abdusco
Copy link

abdusco commented Apr 28, 2020

any chance this gets merged?

@mrmckeb
Copy link
Contributor

mrmckeb commented Apr 28, 2020

Hi @ricardoamedeiros, can you share an example template for me to test with? You can message me privately if that's better - otherwise I can't verify this fix.

@mrmckeb mrmckeb self-assigned this Apr 28, 2020
@ricardoamedeiros
Copy link
Author

ricardoamedeiros commented Apr 28, 2020

Hi @ricardoamedeiros, can you share an example template for me to test with? You can message me privately if that's better - otherwise I can't verify this fix.

I can. Do you prefer a video call? I am portuquese, but we can to try.

@ricardoamedeiros
Copy link
Author

ricardoamedeiros commented Apr 29, 2020

Hi @ricardoamedeiros, can you share an example template for me to test with? You can message me privately if that's better - otherwise I can't verify this fix.

This is my cra-template:

cra-template-sebrae.zip

error:

image

After the correction I applied to the "react-script" it worked:

image

@mrmckeb
Copy link
Contributor

mrmckeb commented Apr 29, 2020

Hi @ricardoamedeiros, the issue you're trying to fix here has actually already been fixed - but not released yet.

Until our next release, you need to have a main field in your template's package.json, which is required by require.resolve.

You can see the commit where we fixed that here:
e0b179c#diff-1453d9590326c639309801105bc967c2

Can you please test adding the main field and confirm that it works? Thanks!

@abdusco
Copy link

abdusco commented Apr 29, 2020

I've been able to use private scoped template @org/cra-template-qwerty using the solution here

solution: just add

{
  "main": "template.json"
}

in package.json

@ricardoamedeiros
Copy link
Author

ricardoamedeiros commented Apr 29, 2020

Hi @ricardoamedeiros, the issue you're trying to fix here has actually already been fixed - but not released yet.

Until our next release, you need to have a main field in your template's package.json, which is required by require.resolve.

You can see the commit where we fixed that here:
e0b179c#diff-1453d9590326c639309801105bc967c2

Can you please test adding the main field and confirm that it works? Thanks!

@abdusco

{
"main": "template.json"
}

It worked. Thanks.

@lock lock bot locked and limited conversation to collaborators May 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants