GithubHelp home page GithubHelp logo

Comments (5)

travispomeroy avatar travispomeroy commented on July 16, 2024

This seems to be due to the fact that cleanAndSetup completely wipes out the react-app-env.d.ts and in removing the NodeJS namespace with the type definition for PUBLIC_URL.

from react-boilerplate-cra-template.

Can-Sahin avatar Can-Sahin commented on July 16, 2024

cleanAndSetup doesn't delete the react-app-env.d.ts file. Are you sure of that?

Does this also happens when you don't eject?

from react-boilerplate-cra-template.

travispomeroy avatar travispomeroy commented on July 16, 2024

@Can-Sahin - Oh no sorry, cleanAndSetup doesn't delete the react-app-env.d.ts file but it modifies the content to just:

/// <reference types="react-scripts" />

// To solve the issue: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/31245
/// <reference types="styled-components/cssprop" />

Doing so we lose the original types definitions, which includes the PUBLIC_URL definition:

declare namespace NodeJS {
  interface ProcessEnv {
    readonly NODE_ENV: 'development' | 'production' | 'test';
    readonly PUBLIC_URL: string;
  }
}

As for the eject, I'm not so sure. I can try tonight and let ya know :)

from react-boilerplate-cra-template.

Can-Sahin avatar Can-Sahin commented on July 16, 2024

/// <reference types="react-scripts" /> line includes the PUBLIC_URL within it self if you navigate inside you will see. Your problem originates from something else and I don't know why

https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/lib/react-app.d.ts

Here you can see the contents of the file which includes your stuff.

from react-boilerplate-cra-template.

Can-Sahin avatar Can-Sahin commented on July 16, 2024

No response. Closing

from react-boilerplate-cra-template.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.