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.

Warnings/errors when following steps in README.md

See original GitHub issue

I’m submitting a…


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[x] Feature request
[x] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

Hi. Just wanted to say thanks for the awesome project idea. I found this from the html-webpack-plugin README and love the idea of being able to get a webpack build going without any initial set-up work.

There are warnings/errors when following the installation steps in README.md:

  • tsconfig.json is missing.
  • Incorrect settings in tsconfig.json when instantiating one with tsc --init
  • A missing babel configuration file.
  • Mode is not passed as a CLI arg.
  • src/index.ts file is required - this is shown in the .gif but not stated anywhere else.

I have taken some steps to get an initial working build but I don’t know about babel, so will be looking into how to set that up.

Expected behavior

Following the installation steps in the README.md gives a webpack build with no warnings/errors.

Minimal reproduction of the problem with instructions

npm init
npm i --save-dev webpack webpack-cli common-config-webpack-plugin
webpack --plugin common-config-webpack-plugin

This gives the following:

Couldn't find a tsconfig.json in the current working directory.
You can either set the configFile path explicitly or create a new config:
  npx tsc --init
Couldn't find an appropriate babel configuration file in the current directory.
                        Please check if the name of the file is correct and if it's in the correct directory.
                        For further information please check the documentation: https://babeljs.io/docs/en/babelrc.html
Starting type checking service...
Using 1 worker with 2048MB memory limit

Insufficient number of arguments or no entry found.
Alternatively, run 'webpack(-cli) --help' for usage info.

Hash: 128e7870f1d9614d6dd9
Version: webpack 4.28.4
Time: 114ms
Built at: 2019-01-16 20:37:32

WARNING in configuration
The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/concepts/mode/

ERROR in Entry module not found: Error: Can't resolve './src' in 'G:\Code\webpack-config-plugins'

Okay, so I am missing:

  • An entry point
  • A typescript config file
  • A babel config file

As mentioned, i haven’t looked into babel yet. If I create a src/index.ts run tsc --init (assuming I have a global tsc) I get some additional warnings:

ts-config-webpack-plugin found 2 warnings in "G:/Code/webpack-config-plugins/tsconfig.json".
Warning:
   skipLibCheck option was NOT specified
   By default the fork-ts-checker-webpack-plugin will check all types inside the node_modules directory
   even for unused dependencies and slow down the type checking a lot.
   To skip that checking add the following line to your tsconfig.json compilerOptions configuration:
   "skipLibCheck": true
   To keep the default behaviour with possible performance penalties set skipLibCheck to false to hide this warning.


Warning:
   moduleResolution option was NOT specified
   This will result in typescript warnings like "module not found".
   To fix that add the following line to your tsconfig.json compilerOptions configuration:
   "moduleResolution": "node"
   To keep the default behaviour with possible type checking errors set moduleResolution to "classic" to hide this warning.

What is the motivation / use case for changing the behavior?

As someone who has dived straight into the installation steps (like other new users will likely do) the presence of warnings and errors makes me assume that something has gone wrong, and I am now going on a journey figuring out what else to add.

I have some experience with typescript/webpack so I will be happy to help with some PRs if you think this should be addressed.

I suggest either of the following:

  • Add steps to the README.md that specify how to create the required files.
  • Update webpack-config-plugins to use defaults in the absence of the config files.

The warnings when using the initialised tsconfig.json suggest that actually there are some values that it expects by default to work correctly?

Perhaps there could be some way to instantiate the files if they are not found?

Environment


- Plugin version: 1.2.1
- Node version: v10.1.0
- Platform: Windows 10

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
jantimoncommented, Jan 20, 2019

@bencoveney I started to improve the experience in https://github.com/namics/webpack-config-plugins/pull/47

cli

Would love to know what you think

0reactions
bencoveneycommented, Jan 28, 2019

👍 This looks great, super clear and easy for new users - thanks for all your help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Warnings/errors when following steps in README.md #42
Incorrect settings in tsconfig.json when instantiating one with tsc --init; A missing babel configuration file. Mode is not passed as a CLI arg....
Read more >
glslang - Google Git
Build steps. The following steps assume a Bash shell. On Windows, that could be the Git Bash shell or some other shell of...
Read more >
New lines inside paragraph in README.md - Stack Overflow
shows every letter on a new line. However, it seems to me that pushing similar markdown source structure in README.md joins all the...
Read more >
microsoft graph github
In the API project, the Graph API client is used in a delegated flow with user access tokens getting an access … GitHub,...
Read more >
How to create a Readme.md file? - Medium
There are plugins for many editors (e.g. Atom, Emacs, Sublime Text, Notepad++, Vim, and Visual Studio Code) or simply notepad. Steps to create...
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