profile
viewpoint

Ask questionsESLint crashes

  • code-server version: v1.604-vscl.32.0
  • OS Version: Debian 9.5
  • Extention: ESLint 1.8.2

Description

Nothing highlights as an eslint issue in the Editor. When I go to the output terminal under eslint, I see the error

[Info  - 14:12:32] ESLint server stopped.
[Info  - 14:12:33] ESLint server running in node v8.15.0
[Info  - 14:12:33] ESLint server is running.
module.js:562
    throw err;
    ^
 
Error: Cannot find module '/home/bitnami/testeslint/src/components/common/-e'
    at Function.Module._resolveFilename (module.js:560:15)
    at Function.Module._load (module.js:487:25)
    at Function.Module.runMain (module.js:726:10)
    at startup (bootstrap_node.js:207:16)
    at bootstrap_node.js:628:3

Where ever the js file you have opened is located in the workspace, the error appears to be looking for a -e file in that same folder? Thus, I tried putting a -e file in /home/bitnami/testeslint/src/components/common/ folder and I got this error on the code-server side

*** Error in `/bin/code-server': free(): invalid pointer: 0x00007f8997d23520 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x70bfb)[0x7f89979f9bfb]
/lib/x86_64-linux-gnu/libc.so.6(+0x76fc6)[0x7f89979fffc6]
/lib/x86_64-linux-gnu/libc.so.6(+0x7780e)[0x7f8997a0080e]
/bin/code-server(_ZN4node5StartEiPPc+0x3d9)[0x858ab9]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf1)[0x7f89979a92e1]
/bin/code-server(_start+0x29)[0x81e7b9]
======= Memory map: ========
00400000-01fdf000 r-xp 00000000 103:01 630681                            /bin/code-server
021df000-021e0000 r--p 01bdf000 103:01 630681                            /bin/code-server
021e0000-021fa000 rw-p 01be0000 103:01 630681                            /bin/code-server
021fa000-02210000 rw-p 00000000 00:00 0
02cf9000-02e64000 rw-p 00000000 00:00 0                                  [heap]
7f8980000000-7f8980021000 rw-p 00000000 00:00 0
7f8980021000-7f8984000000 ---p 00000000 00:00 0
7f8988000000-7f8988021000 rw-p 00000000 00:00 0
7f8988021000-7f898c000000 ---p 00000000 00:00 0
7f898c000000-7f898c021000 rw-p 00000000 00:00 0
7f898c021000-7f8990000000 ---p 00000000 00:00 0
7f8990000000-7f8990021000 rw-p 00000000 00:00 0
7f8990021000-7f8994000000 ---p 00000000 00:00 0
7f8995985000-7f8995986000 ---p 00000000 00:00 0
7f8995986000-7f8996186000 rw-p 00000000 00:00 0
7f8996186000-7f8996187000 ---p 00000000 00:00 0
7f8996187000-7f8996987000 rw-p 00000000 00:00 0
7f8996987000-7f8996988000 ---p 00000000 00:00 0
7f8996988000-7f8997188000 rw-p 00000000 00:00 0
7f8997188000-7f8997189000 ---p 00000000 00:00 0
7f8997189000-7f8997989000 rw-p 00000000 00:00 0
7f8997989000-7f8997b1e000 r-xp 00000000 103:01 263347                    /lib/x86_64-linux-gnu/libc-2.24.so
7f8997b1e000-7f8997d1e000 ---p 00195000 103:01 263347                    /lib/x86_64-linux-gnu/libc-2.24.so
7f8997d1e000-7f8997d22000 r--p 00195000 103:01 263347                    /lib/x86_64-linux-gnu/libc-2.24.so
7f8997d22000-7f8997d24000 rw-p 00199000 103:01 263347                    /lib/x86_64-linux-gnu/libc-2.24.so
7f8997d24000-7f8997d28000 rw-p 00000000 00:00 0
7f8997d28000-7f8997d40000 r-xp 00000000 103:01 263362                    /lib/x86_64-linux-gnu/libpthread-2.24.so
7f8997d40000-7f8997f3f000 ---p 00018000 103:01 263362                    /lib/x86_64-linux-gnu/libpthread-2.24.so
7f8997f3f000-7f8997f40000 r--p 00017000 103:01 263362                    /lib/x86_64-linux-gnu/libpthread-2.24.so
7f8997f40000-7f8997f41000 rw-p 00018000 103:01 263362                    /lib/x86_64-linux-gnu/libpthread-2.24.so
7f8997f41000-7f8997f45000 rw-p 00000000 00:00 0
7f8997f45000-7f8997f5b000 r-xp 00000000 103:01 263298                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7f8997f5b000-7f899815a000 ---p 00016000 103:01 263298                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7f899815a000-7f899815b000 r--p 00015000 103:01 263298                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7f899815b000-7f899815c000 rw-p 00016000 103:01 263298                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7f899815c000-7f899825f000 r-xp 00000000 103:01 263351                    /lib/x86_64-linux-gnu/libm-2.24.so
7f899825f000-7f899845e000 ---p 00103000 103:01 263351                    /lib/x86_64-linux-gnu/libm-2.24.so
7f899845e000-7f899845f000 r--p 00102000 103:01 263351                    /lib/x86_64-linux-gnu/libm-2.24.so
7f899845f000-7f8998460000 rw-p 00103000 103:01 263351                    /lib/x86_64-linux-gnu/libm-2.24.so
7f8998460000-7f89985d2000 r-xp 00000000 103:01 267518                    /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22
7f89985d2000-7f89987d2000 ---p 00172000 103:01 267518                    /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22
7f89987d2000-7f89987dc000 r--p 00172000 103:01 267518                    /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22
7f89987dc000-7f89987de000 rw-p 0017c000 103:01 267518                    /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22
7f89987de000-7f89987e2000 rw-p 00000000 00:00 0
7f89987e2000-7f89987e9000 r-xp 00000000 103:01 263364                    /lib/x86_64-linux-gnu/librt-2.24.so
7f89987e9000-7f89989e8000 ---p 00007000 103:01 263364                    /lib/x86_64-linux-gnu/librt-2.24.so
7f89989e8000-7f89989e9000 r--p 00006000 103:01 263364                    /lib/x86_64-linux-gnu/librt-2.24.so
7f89989e9000-7f89989ea000 rw-p 00007000 103:01 263364                    /lib/x86_64-linux-gnu/librt-2.24.so
7f89989ea000-7f89989ed000 r-xp 00000000 103:01 263350                    /lib/x86_64-linux-gnu/libdl-2.24.so
7f89989ed000-7f8998bec000 ---p 00003000 103:01 263350                    /lib/x86_64-linux-gnu/libdl-2.24.so
7f8998bec000-7f8998bed000 r--p 00002000 103:01 263350                    /lib/x86_64-linux-gnu/libdl-2.24.so
7f8998bed000-7f8998bee000 rw-p 00003000 103:01 263350                    /lib/x86_64-linux-gnu/libdl-2.24.so
7f8998bee000-7f8998c11000 r-xp 00000000 103:01 263343                    /lib/x86_64-linux-gnu/ld-2.24.so
7f8998e02000-7f8998e08000 rw-p 00000000 00:00 0
7f8998e09000-7f8998e0a000 rw-p 00000000 00:00 0
7f8998e0a000-7f8998e0b000 ---p 00000000 00:00 0
7f8998e0b000-7f8998e11000 rw-p 00000000 00:00 0
7f8998e11000-7f8998e12000 r--p 00023000 103:01 263343                    /lib/x86_64-linux-gnu/ld-2.24.so
7f8998e12000-7f8998e13000 rw-p 00024000 103:01 263343                    /lib/x86_64-linux-gnu/ld-2.24.so
7f8998e13000-7f8998e14000 rw-p 00000000 00:00 0
7ffe451ea000-7ffe4520b000 rw-p 00000000 00:00 0                          [stack]
7ffe45239000-7ffe4523b000 r--p 00000000 00:00 0                          [vvar]
7ffe4523b000-7ffe4523d000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]

Steps to Reproduce

  1. create a new react app using npx create-react-app .
  2. In the VSCode editor install the latest ESLint extention
  3. In the VSCode editor use the Command-Palette to "Create Eslint configuration"
  4. remove the lastest version of eslint from the package.json and rebuild the node_modules folder (this is because react-scripts requires the previous version of eslint?)
  5. reboot code-server
  6. open any js file and view the output - eslint log console to see the error.
cdr/code-server

Answer questions jbotSandbox

Oh ok that fixed it for me!

But then I was getting the error

Parsing error: The keyword 'import' is reserved eslint

After googling it, I added the json below to my .eslintrs.js

    "parserOptions": {
        "ecmaVersion": 6,
        "sourceType": "module",
        "ecmaFeatures": {
            "jsx": true,
            "modules": true
        }
    } 

But that gave me the error

'React' is defined but never used.eslint(no-unused-vars)

I fixed that one by switching to

"extends": [ 'plugin:react/recommended' ],

Now I think everything is working! Thank you for your help!

useful!
source:https://uonfu.com/
Github User Rank List