Skip to content
This repository was archived by the owner on Jan 26, 2019. It is now read-only.
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

The less template has errors on start after clean install #318

Closed
@Kizmar

Description

@Kizmar

Is this a bug report?

Yes.

Can you also reproduce the problem with npm 4.x?

I'm on npm 5.6.0. I'd like to avoid down-grading if possible. If this only works on 4 I'll use something else.

Environment

  1. npm ls react-scripts-ts (if you haven’t ejected): my-app@0.1.0 C:<path_to_my_app> `-- (empty)
  2. node -v: v8.11.1
  3. npm -v: 5.6.0
  4. yarn --version (if you use Yarn): 1.3.2
  5. npm ls react-scripts-ts (if you haven’t ejected): Again? Same result as The 'eject' script results in an error. #1.

Then, specify:

  1. Operating system: Windows 10
  2. Browser and version (if relevant): current Chrome, but not relevant

Steps to Reproduce

  1. Run "npx create-react-app test --scripts-version=react-scripts-ts-less"
  2. wait for install to do the things
  3. Observe success message, follow instructions
  4. cd to app directory
  5. Run "yarn start"
  6. Observe error: "Failed to load tsconfig.json: Missing baseUrl in compilerOptions"
  7. Add "baseUrl": "." to compilerOptions section of tsconfig.json
  8. Run "yarn start"
  9. Observe error:

Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
configuration.module has an unknown property 'preLoaders'. These properties are valid:
object { exprContextCritical?, exprContextRecursive?, exprContextRegExp?, exprContextRequest?, loaders?, noParse?, rules?, unknownContextCritical?, unknownContextRecursive?, unknownContextRegExp?, unknownContextRequest?, unsafeCache?, wrappedContextCritical?, wrappedC
ontextRecursive?, wrappedContextRegExp?, strictExportPresence?, strictThisContextOnImports? }
Options affecting the normal modules (NormalModuleFactory).

  1. Stopped messing with this because it shouldn't be this difficult.

Expected Behavior

Run the install, run "yarn start", app starts with no errors. When I run npx create-react-app test --scripts-version=react-scripts-ts, it works as expected, so I would assume this is an issue with the less template.

Actual Behavior

See Steps to Reproduce. Specifically steps #6 & #9.

Reproducible Demo

I'm skipping this part at the risk of not being helped. The fact that this won't run out of the gate should be enough of a test. If this is related to the npm version used, I'll just go back to using the non-less template and add less support myself.

Activity

DorianGrey

DorianGrey commented on May 5, 2018

@DorianGrey
Collaborator

The package react-scripts-ts-less is in no way related to this project. It's owner saidireddy.basireddy has published two packages that seem to be refering to a setup including less, however the repository links are simply wrong, since they still point to this repository.

I'm not sure who that author is, but he/she/whatever is in no way related to this fork.

I was able to have a glimpse at the package on runkit and figure out what causes the problem you mentioned - see
https://npm.runkit.com/react-scripts-ts-less/config/webpack.config.dev.js in line 133:
preLoaders is not a valid webpack configuration anymore, it was removed in v3 in favor of the enforce: 'pre' configuration option when defining a loader.
So it seems that this "project" does not only use (intentionally?) use misleading owner resp. repository links, but also messed up the configuration contents, i.e. invalidating them.

wmonk

wmonk commented on May 10, 2018

@wmonk
Owner

Going to close due to no feedback. Please reopen if there are any further developments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @wmonk@Kizmar@DorianGrey

        Issue actions

          The less template has errors on start after clean install · Issue #318 · wmonk/create-react-app-typescript