Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getting error You may need an appropriate loader to handle this file type in electron.js #444

Open
ibalaji777 opened this issue May 1, 2021 · 1 comment

Comments

@ibalaji777
Copy link

ibalaji777 commented May 1, 2021

my server.js fie

 var express = require('express')
 var app = express()
 var PouchDB = require('pouchdb')
 app.use('/', require('express-pouchdb')(PouchDB))
 app.listen(5000)
 var db = new PouchDB('mydb')
 db.changes({live: true}).on('change', console.log)

i called in electron background.js

### getting error


 ERROR  Failed to compile with 1 errors                                                                                                                                                                  6:53:42 AM

 error  in ./node_modules/pouchdb-fauxton/www/index.html

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
> <!doctype html>
| <html lang="en">
| <head>

 @ ./node_modules/express-pouchdb/lib/routes/fauxton.js 7:32-66
 @ ./node_modules/express-pouchdb/lib sync ^\.\/.*$
 @ ./node_modules/express-pouchdb/lib/index.js
 @ ./backend_db/server.js
 @ ./src/background.js
 @ multi ./src/background.js
@afonsocachim
Copy link

I know this is late but i fixed this error by adding the following code to my webpack config

module: {
    rules: [
      {
        test: /\.html$/i,
        loader: "html-loader",
      },
    ],
  },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants