pouchdb / pouchdb-server

CouchDB-compatible server built on PouchDB and Node
Apache License 2.0
944 stars 155 forks source link

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

Open ibalaji777 opened 3 years ago

ibalaji777 commented 3 years ago

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 commented 2 years ago

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",
      },
    ],
  },