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.

Unexpected character '#'

See original GitHub issue

When I try to require sqlite3 I got error:

ERROR in ./~/sqlite3/~/rc/index.js
Module parse failed: .../node_modules/sqlite3/node_modules/rc/index.js Unexpected character '#' (1:0)
You may need an appropriate loader to handle this file type.
| #! /usr/bin/env node
| var cc   = require('./lib/utils')
| var join = require('path').join
 @ ./~/sqlite3/~/node-pre-gyp/lib/publish.js 14:13-26
 @ ./~/sqlite3/~/node-pre-gyp/lib ^\.\/.*$
 @ ./~/sqlite3/~/node-pre-gyp/lib/node-pre-gyp.js
 @ ./~/sqlite3/lib/sqlite3.js
 @ ./spec/videopage.js
 @ ./spec/index.js
 @ multi webpack-hot-middleware/client babel-polyfill ./spec/index.js

Webpack config:

	resolve: {
		extensions: [
			'.js', '.jsx', '.css', 'json'
		],
		modules: ['node_modules']
	},
	node: {
		fs: "empty",
		dns: "empty",
		net: "empty",
		tls: "empty",
		"child_process": "empty"
	},
	module: {
		rules: [
			{
				test: /\.json$/,
				loader: 'json-loader'
			}, {
				test: /\.js$/,
				use: 'babel-loader',
				include: [
					path.join(__dirname, '../components'),
					path.join(__dirname, '../spec')
				]
			}
...

.babelrc

  "presets": ["es2015", "stage-0", "react"]
...

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
hzoocommented, Nov 8, 2017

Oh what I mean is you should do something like

{
   test: /\.js$/,
   use: 'babel-loader',
+  exclude: /node_modules/,
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Unexpected Character - TV Tropes
They could be a One-Scene Wonder, someone who had succumbed to Chuck Cunningham Syndrome, simply a Living Prop, a Joke Character, or even...
Read more >
1:1 error Parsing error: Unexpected character ' ' - Stack Overflow
It look like UTF-8 BOM in the begin of your file. If you have notepad++ you can remove it by click to "Encoding"...
Read more >
Unexpected CHARACTER - Episode Support
"Unexpected CHARACTER". This error means the line of code before your character dialogue has an error. · "Unexpected CHARACTER or Scene change".
Read more >
ParseError: Unexpected character '@' #15832 - GitHub
I'm getting this parsing error (i.e., error Unexpected character '@' ParseError ) returned when running eslint --cache --fix .
Read more >
Unexpected character encountered while parsing value
Unexpected character encountered while parsing value: P. Path '', line 0, position 0. Question. Reactive. API. Application Type. Reactive.
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