1

I am getting the following error.

ERROR in ./node_modules/react-clock/dist/Clock.css 1:0

Module parse failed: Unexpected token (1:0) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

.react-clock { | display: block; | position: relative;

ERROR in ./node_modules/react-time-picker/dist/TimePicker.css 1:0 Module parse failed: Unexpected token (1:0) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

.react-time-picker { | display: inline-flex; | position: relative; i 「wdm」: Failed to compile.

1
  • 1
    Can you send us your webpack config (at least the module.rules part)? Commented Oct 16, 2019 at 7:21

2 Answers 2

1

I am able to solve the issue by just replacing the code.

Older

{
       test: /\.css$/,
       exclude: /node_modules/,
       use: ["style-loader", "css-loader"]}

Newer

{ test: /\.css$/, use: ["style-loader", "css-loader"] },

I was using a css file from the node_modules and it was excluded.

Thanks for the help Guys

Sign up to request clarification or add additional context in comments.

Comments

0

You could use css loader for this, Add the following to the rules array in webpack config should be fine:

{
  test: /\.css$/,
  // exclude: /node_modules/,
  use: [
      {
        loader: "style-loader",
      },
      {
        loader: "css-loader",
        options: {
          importLoaders: 1,
        },
      },
    ],
},

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.