Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Constant error notifications poping up in dev mode #765

Closed
abe33 opened this issue Dec 8, 2016 · 8 comments
Closed

Constant error notifications poping up in dev mode #765

abe33 opened this issue Dec 8, 2016 · 8 comments

Comments

@abe33
Copy link

abe33 commented Dec 8, 2016

Issue Type

Bug

Issue Description

When running Atom in dev mode in a package project, while there's no eslint config and the config to disable the linter in projects without config, it keeps raising exception while attempting to lint the ES6 code from Atom itself...

Annoying!!

@Arcanemagus
Copy link
Member

Arcanemagus commented Dec 8, 2016

Does the Debug command run? The information from that would answer a few questions.

@joefitzgerald
Copy link

I am also experiencing this issue. Thedebug command doesn't seem to run.

[Linter-ESLint] STDERR /Users/joe/github/atom/exports/atom.js:3
import TextBuffer, {Point, Range} from 'text-buffer'
^^^^^^
SyntaxError: Unexpected token import
    at Object.exports.runInThisContext (vm.js:76:16)
    at Module._compile (module.js:528:28)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/joe/.atom/packages/linter-eslint/node_modules/atom-linter/lib/index.js:133:13)
    at Module._compile (module.js:556:32)

@Arcanemagus
Copy link
Member

Arcanemagus commented Dec 29, 2016

From private chats:

  • Both @abe33 and @joefitzgerald are on builds of Atom from its master branch
  • Attempting to reproduce this on the released stable and beta builds yields no results on my machine
  • The traceback from this package's code leads to a call to require('atom')

@abe33
Copy link
Author

abe33 commented Jan 2, 2017

I've tried to investigate the issue this morning and I think the issues comes from the way you're forking the process to initiate your worker.

In dev mode, when Atom is built from sources, atom will loads its own sources and compile them on the fly in require as with other packages so that we can work with the current sources without having to rebuild Atom.

As you're forking the Atom process without relying on the Task class, the require method in the worker isn't patched to transpile files on the fly, resulting in these errors.

This might get quickly critical as the Atom core team is moving to eslint from standard and most will want to have a working linter even when running atom in dev mode.

@Arcanemagus
Copy link
Member

Ah, that makes a lot of sense. Fixing that is going to require splitting the atom-linter module up into the parts that actually require Atom, and the parts that are just plain Node code.

@abe33
Copy link
Author

abe33 commented Jan 4, 2017

Hmm, can't you use a Task instead? It looks like it does pretty much the same thing as you're doing, forking the current process and then running a specific file (see https://atom.io/docs/api/v1.12.8/Task).

@Arcanemagus
Copy link
Member

Actually, this should stay open till a version is published that includes it.

@Arcanemagus
Copy link
Member

Arcanemagus commented Feb 15, 2017

v8.1.2 should work just fine in this environment!

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

No branches or pull requests

3 participants