Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

[publish]
[publish] ERROR in ./node_modules/@fortawesome/fontawesome-free/css/all.min.css
[publish] Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
[publish] ModuleParseError: Module parse failed: Unexpected character '' (1:4)
[publish] 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
[publish] (Source code omitted for this binary file)
[publish]     at handleParseError (D:WebstormProjectscustomer-frontend-flareact
ode_moduleswebpacklibNormalModule.js:469:19)
[publish]     at D:WebstormProjectscustomer-frontend-flareact
ode_moduleswebpacklibNormalModule.js:503:5
[publish]     at D:WebstormProjectscustomer-frontend-flareact
ode_moduleswebpacklibNormalModule.js:358:12
[publish]     at D:WebstormProjectscustomer-frontend-flareact
ode_modulesloader-runnerlibLoaderRunner.js:373:3
[publish]     at iterateNormalLoaders (D:WebstormProjectscustomer-frontend-flareact
ode_modulesloader-runnerlibLoaderRunner.js:214:10)
[publish]     at Array.<anonymous> (D:WebstormProjectscustomer-frontend-flareact
ode_modulesloader-runnerlibLoaderRunner.js:205:4)
[publish]     at Storage.finished (D:WebstormProjectscustomer-frontend-flareact
ode_modulesenhanced-resolvelibCachedInputFileSystem.js:55:16)
[publish]     at D:WebstormProjectscustomer-frontend-flareact
ode_modulesenhanced-resolvelibCachedInputFileSystem.js:91:9
[publish]     at D:WebstormProjectscustomer-frontend-flareact
ode_modulesgraceful-fsgraceful-fs.js:123:16
[publish]     at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:63:3)
[publish] webpack --config node_modules/flareact/configs/webpack.client.config.js --out ./out --mode production && wrangler publish exited with code 2
[
  {
    command: {
      command: 'webpack --config node_modules/flareact/configs/webpack.client.config.js --out ./out --mode production && wrangler publish',
      name: 'publish',
      prefixColor: '',
      env: [Object]
    },
    index: 0,
    exitCode: 2
  }
]

i installed postcss and postcss-loader, but it still failed to deploy. I using flareact, is a framework develop by cloudflare for their worker. I tried to install css-loader, put file-loader and url-loader for other non-css file, but none of the method is working. The svg loader is added because when npm run deploy, it show svg file needs loader, so I added that svg loader for it.

Below is my flareact.config.js

module.exports = {
    webpack: (config, options) => {
        config.module.rules.push(
            {
                test: /.(svg)$/,
                use: [
                    { loader: "file-loader", options: {} },
                    { loader: "svg-url-loader", options: {} },
                ],
            },
            {
                test: /.(ttf|eot|png|jpg|gif|ico)(?v=[0-9].[0-9].[0-9])?$/,
                use: [
                    { loader: "file-loader", options: {} },
                    {
                        loader: "url-loader",
                        options: {
                            limit: 10000,
                        },
                    },
                ],
            }
        );
        config.node = {
            fs: "empty",
        };

        return config;
    },
};


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
357 views
Welcome To Ask or Share your Answers For Others

1 Answer

等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...