You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Atom Version: 0.211.0 System: Mac OS X 10.10.3 Thrown From: spell-check package, v0.59.0
Stack Trace
Failed to activate the spell-check package
At Cannot read property 'scopeName' of undefined
TypeError: Cannot read property 'scopeName' of undefined
at SpellCheckView.module.exports.SpellCheckView.spellCheckCurrentGrammar (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/spell-check/lib/spell-check-view.js:77:41)
at SpellCheckView.module.exports.SpellCheckView.subscribeToBuffer (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/spell-check/lib/spell-check-view.js:64:16)
at new SpellCheckView (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/spell-check/lib/spell-check-view.js:44:12)
at addViewToEditor (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/spell-check/lib/main.js:25:12)
at Workspace.module.exports.Workspace.observeTextEditors (/Applications/Atom.app/Contents/Resources/app.asar/src/workspace.js:276:9)
at Object.module.exports.activate (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/spell-check/lib/main.js:14:47)
at Package.module.exports.Package.activateNow (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:240:19)
at /Applications/Atom.app/Contents/Resources/app.asar/src/package.js:221:30
at Package.module.exports.Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:165:15)
at Package.module.exports.Package.activate (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:213:14)
@sinejoe@Elaho@furins Sorry for the delay in getting back to you on this. Are you still seeing this issue in Atom 1.0.11? If so, do you see the problem when you start Atom in safe mode? Also, can you please provide at least one file for which this error happens so that we can try and reproduce? Or does this happen when you attempt to open any file in any project?
Using Atom 1.3.2 on Windows 7. I got spell-checking working out of the box on one computer, but when I installed Atom with the same packages and settings on another computer (still Win7), it just doesn't work, without even leaving a stack trace...
Note: the placeholder text in the settings shows: Default: source.asciidoc, source.gfm, text.git-commit, text.plain, text.plain.null-grammar
I try to get spell-checking in Markdown documents (extension: .md). I don't know if this falls into the above categories. The setting descriptions says: "See the README for more information on finding the correct scope for a specific language." but the readme file don't tell anything about these file types, so I am not sure how to add explicitly the Markdown type.
Update: I removed Atom from the problematic computer. Cleared all three folders (had problems with packages with too deep dependency tree, exceeding the Windows' max length path; solved by moving up node_modules for these packages).
I made a fresh install of Atom 1.3.2. I opened a .md file without changing anything to the settings (so, no 3rd party package, default settings, etc.). Still no spell checking... :-(
The first computer uses Windows 7 Professional; the second one, with the problem, uses Windows 10 (upgraded from 7).
Still no evidence of problem in the console, making my reports a bit useless, alas. I am trying to locate the package' source, to try and debug.
I located the sources in the DevTools. It was not obvious, because all files start with C:\Users\PhiLho\AppData\Local\atom\app-1.3.2\resources\app.asar\node_modules\ which is near of the limit displayed by DevTools...
I found out that spell checking kicks in, it pass the file to the task, which returns an empty result: no spelling errors found! The task's PID can be seen in the Task Manager, so it is really started. Maybe it was not able to load the dictionary? Maybe the paths are too deep for a non-professional version of Windows?
Throwing in ideas, wild guesses... If you can suggest ways to bring more information...
Side note: there are 6 Atom processes started. When I see the command line of launch, half of them has no quotes around the path to Atom. It is OK on my system as there are no spaces in the path, but on some systems, it might be problematic.
Am seeing this issue again in 1.26 beta0
[Enter steps to reproduce:]
...
...
Atom: 1.26.0-beta0 x64 Electron: 1.7.11 OS: Mac OS X 10.13.4 Thrown From: spell-check package 0.73.1
Stack Trace
Failed to activate the spell-check package
At Could not find module root given file: "/private/var/folders/m_/zp9plyps3dv8kgnzrx89161h0000gn/T/AppTranslocation/11C6B0EF-4DF2-4E37-A568-84C5AD57478C/d/Atom Beta.app/Contents/Resources/app.asar/node_modules/bindings/bindings.js". Do you have a `package.json` file?
Error: Could not find module root given file: "/private/var/folders/m_/zp9plyps3dv8kgnzrx89161h0000gn/T/AppTranslocation/11C6B0EF-4DF2-4E37-A568-84C5AD57478C/d/Atom Beta.app/Contents/Resources/app.asar/node_modules/bindings/bindings.js". Do you have a `package.json` file?
at Function.getRoot (/app.asar/node_modules/bindings/bindings.js:159:13)
at bindings (/app.asar/node_modules/bindings/bindings.js:55:32)
at /app.asar/node_modules/webworker-threads/index.js:1:198)
at /app.asar/node_modules/webworker-threads/index.js:5:3)
at Module.get_Module._compile (/private/var/folders/m_/zp9plyps3dv8kgnzrx89161h0000gn/T/AppTranslocation/F420E561-7B99-4411-BF45-18A27B39B78D/d/Atom Beta.app/Contents/Resources/app/src/native-compile-cache.js:106:36)
at Object.value [as .js] (/private/var/folders/m_/zp9plyps3dv8kgnzrx89161h0000gn/T/AppTranslocation/F420E561-7B99-4411-BF45-18A27B39B78D/d/Atom Beta.app/Contents/Resources/app/src/compile-cache.js:240:29)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (/app.asar/static/index.js:47:45)
at require (/private/var/folders/m_/zp9plyps3dv8kgnzrx89161h0000gn/T/AppTranslocation/F420E561-7B99-4411-BF45-18A27B39B78D/d/Atom Beta.app/Contents/Resources/app/src/native-compile-cache.js:66:33)
at /app.asar/node_modules/spelling-manager/node_modules/natural/lib/natural/classifiers/classifier.js:29:19)
at /app.asar/node_modules/spelling-manager/node_modules/natural/lib/natural/classifiers/classifier.js:461:3)
at Module.get_Module._compile (/private/var/folders/m_/zp9plyps3dv8kgnzrx89161h0000gn/T/AppTranslocation/F420E561-7B99-4411-BF45-18A27B39B78D/d/Atom Beta.app/Contents/Resources/app/src/native-compile-cache.js:106:36)
at Object.value [as .js] (/private/var/folders/m_/zp9plyps3dv8kgnzrx89161h0000gn/T/AppTranslocation/F420E561-7B99-4411-BF45-18A27B39B78D/d/Atom Beta.app/Contents/Resources/app/src/compile-cache.js:240:29)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (/app.asar/static/index.js:47:45)
at require (/private/var/folders/m_/zp9plyps3dv8kgnzrx89161h0000gn/T/AppTranslocation/F420E561-7B99-4411-BF45-18A27B39B78D/d/Atom Beta.app/Contents/Resources/app/src/native-compile-cache.js:66:33)
at /app.asar/node_modules/spelling-manager/node_modules/natural/lib/natural/classifiers/bayes_classifier.js:24:18)
at /app.asar/node_modules/spelling-manager/node_modules/natural/lib/natural/classifiers/bayes_classifier.js:61:3)
at Module.get_Module._compile (/private/var/folders/m_/zp9plyps3dv8kgnzrx89161h0000gn/T/AppTranslocation/F420E561-7B99-4411-BF45-18A27B39B78D/d/Atom Beta.app/Contents/Resources/app/src/native-compile-cache.js:106:36)
at Object.value [as .js] (/private/var/folders/m_/zp9plyps3dv8kgnzrx89161h0000gn/T/AppTranslocation/F420E561-7B99-4411-BF45-18A27B39B78D/d/Atom Beta.app/Contents/Resources/app/src/compile-cache.js:240:29)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (/app.asar/static/index.js:47:45)
at require (/private/var/folders/m_/zp9plyps3dv8kgnzrx89161h0000gn/T/AppTranslocation/F420E561-7B99-4411-BF45-18A27B39B78D/d/Atom Beta.app/Contents/Resources/app/src/native-compile-cache.js:66:33)
at /app.asar/node_modules/spelling-manager/node_modules/natural/lib/natural/index.js:59:27)
at /app.asar/node_modules/spelling-manager/node_modules/natural/lib/natural/index.js:94:3)
at Module.get_Module._compile (/private/var/folders/m_/zp9plyps3dv8kgnzrx89161h0000gn/T/AppTranslocation/F420E561-7B99-4411-BF45-18A27B39B78D/d/Atom Beta.app/Contents/Resources/app/src/native-compile-cache.js:106:36)
at Object.value [as .js] (/private/var/folders/m_/zp9plyps3dv8kgnzrx89161h0000gn/T/AppTranslocation/F420E561-7B99-4411-BF45-18A27B39B78D/d/Atom Beta.app/Contents/Resources/app/src/compile-cache.js:240:29)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
@rcrooks: Thanks for letting us know that you're running into this issue. I'm attempting to reproduce it, but I haven't been able to do so. Does it happen for you every time you open Atom?
Error: Could not find module root given file: "/private/var/folders/m_/zp9plyps3dv8kgnzrx89161h0000gn/T/AppTranslocation/11C6B0EF-4DF2-4E37-A568-84C5AD57478C/d/Atom Beta.app/Contents/Resources/app.asar/node_modules/bindings/bindings.js". Do you have a `package.json` file?
at Function.getRoot (/app.asar/node_modules/bindings/bindings.js:159:13)
at bindings (/app.asar/node_modules/bindings/bindings.js:55:32)
at /app.asar/node_modules/webworker-threads/index.js:1:198)
@maxbrunsfeld@as-cii: Do you see anything in that stack trace ☝️ that might offer a hint as to the root cause of this issue? I'd love to resolve this problem before Atom 1.26 graduates from beta to stable.
The error looks like it's related to the webworker-threads module, a dependency of the spelling-manager module, which was added by @dmoonfire in #120.
I'm not familiar with webworker-threads but it looks like it is a native module that lets you write multi-threaded javascript code.
It seems that it uses an old node module called bindings that automatically find the location of a native node module that you're trying to require. We typically don't use bindings for the native modules that we use elsewhere in Atom; we just require native modules using normal hard-coded paths. It's possible that bindings is interacting badly with asar?
@dmoonfire do you have any insight into what might be going on here?
@maxbrunsfeld: Thanks for that insight. 🙇⚡ tl;dr I think we might be able to resolve this issue by omitting the webworker-threads module from the build. I've described my findings so far below. Does this idea seem reasonable? If so, is there a preferred way to omit the webworker-threads module from the build?
I think the issue we're seeing has to due with natural's dependency on webworker-threads. I came across a few other people mentioning issues attempting to use the webworker-threads module with Electron:
The natural module declares webworker-threads as an optionalDependency (NaturalNode/natural#354). If webworker-threads is installed, the natural module attempts to use it [code].
NaturalNode/natural#368 explains that deleting the the webworker-threads module only works on Node, and not on Electron.
NaturalNode/natural#368 goes on to say that you can work around the issue by deleting the node_modules/webworker-threads folder after installing the natural module. I tried that, and it seems to do the trick. Here's the behavior I'm seeing:
cd ~/github/spell-check && apm link && apm install
Open Atom and observe error: "Failed to activate the spell-check package"
Reload Atom and observe that error no longer occurs
Since that seems to resolve the issue, is there a way that we can teach Atom (or the spell-check package) to not install the webworker-threads module?
One (super hacky) option might be to add a post-install hook on the spell-check package to delete the webworker-threads module. For example, imagine something like this, but tweaked to run in a cross-platform manner:
@jasonrudolph I am also able to reproduce it sometimes but not every time. I'll grab a stack trace next time I encounter it. is there any other debug output that would be helpful that I could try to capture?
The problem seen in #67 (comment) should be resolved by #246. That fix is included in Atom 1.26-beta2 (released today) and will be part of Atom 1.26 stable when it is released.
I'm going to close this issue. If you're using Atom 1.26-beta2 (or newer) and you continue to see this problem, please open a new issue to let us know.
Activity
furins commentedon Jun 25, 2015
Same here on a mac. Possibly related issue: atom/atom#6235
izuzak commentedon Sep 13, 2015
@sinejoe @Elaho @furins Sorry for the delay in getting back to you on this. Are you still seeing this issue in Atom 1.0.11? If so, do you see the problem when you start Atom in safe mode? Also, can you please provide at least one file for which this error happens so that we can try and reproduce? Or does this happen when you attempt to open any file in any project?
PhiLhoSoft commentedon Dec 21, 2015
Using Atom 1.3.2 on Windows 7. I got spell-checking working out of the box on one computer, but when I installed Atom with the same packages and settings on another computer (still Win7), it just doesn't work, without even leaving a stack trace...
Note: the placeholder text in the settings shows:
I try to get spell-checking in Markdown documents (extension: .md). I don't know if this falls into the above categories. The setting descriptions says: "See the README for more information on finding the correct scope for a specific language." but the readme file don't tell anything about these file types, so I am not sure how to add explicitly the Markdown type.
PhiLhoSoft commentedon Dec 29, 2015
Update: I removed Atom from the problematic computer. Cleared all three folders (had problems with packages with too deep dependency tree, exceeding the Windows' max length path; solved by moving up node_modules for these packages).
I made a fresh install of Atom 1.3.2. I opened a .md file without changing anything to the settings (so, no 3rd party package, default settings, etc.). Still no spell checking... :-(
The first computer uses Windows 7 Professional; the second one, with the problem, uses Windows 10 (upgraded from 7).
Still no evidence of problem in the console, making my reports a bit useless, alas. I am trying to locate the package' source, to try and debug.
PhiLhoSoft commentedon Dec 29, 2015
I located the sources in the DevTools. It was not obvious, because all files start with
C:\Users\PhiLho\AppData\Local\atom\app-1.3.2\resources\app.asar\node_modules\which is near of the limit displayed by DevTools...I found out that spell checking kicks in, it pass the file to the task, which returns an empty result: no spelling errors found! The task's PID can be seen in the Task Manager, so it is really started. Maybe it was not able to load the dictionary? Maybe the paths are too deep for a non-professional version of Windows?
Throwing in ideas, wild guesses... If you can suggest ways to bring more information...
Side note: there are 6 Atom processes started. When I see the command line of launch, half of them has no quotes around the path to Atom. It is OK on my system as there are no spaces in the path, but on some systems, it might be problematic.
rcrooks commentedon Apr 1, 2018
Am seeing this issue again in 1.26 beta0
[Enter steps to reproduce:]
Atom: 1.26.0-beta0 x64
Electron: 1.7.11
OS: Mac OS X 10.13.4
Thrown From: spell-check package 0.73.1
Stack Trace
Failed to activate the spell-check package
Commands
Non-Core Packages
jasonrudolph commentedon Apr 9, 2018
@rcrooks: Thanks for letting us know that you're running into this issue. I'm attempting to reproduce it, but I haven't been able to do so. Does it happen for you every time you open Atom?
rcrooks commentedon Apr 9, 2018
@jasonrudolph no, that's the odd thing. It appears sometimes, but not every time. and only on the beta version (1.26.1, not the release version
jasonrudolph commentedon Apr 9, 2018
@maxbrunsfeld @as-cii: Do you see anything in that stack trace ☝️ that might offer a hint as to the root cause of this issue? I'd love to resolve this problem before Atom 1.26 graduates from beta to stable.
maxbrunsfeld commentedon Apr 9, 2018
The error looks like it's related to the
webworker-threadsmodule, a dependency of thespelling-managermodule, which was added by @dmoonfire in #120.I'm not familiar with
webworker-threadsbut it looks like it is a native module that lets you write multi-threaded javascript code.It seems that it uses an old node module called
bindingsthat automatically find the location of a native node module that you're trying to require. We typically don't usebindingsfor the native modules that we use elsewhere in Atom; we just require native modules using normal hard-coded paths. It's possible thatbindingsis interacting badly withasar?@dmoonfire do you have any insight into what might be going on here?
jasonrudolph commentedon Apr 11, 2018
@maxbrunsfeld: Thanks for that insight. 🙇⚡ tl;dr I think we might be able to resolve this issue by omitting the webworker-threads module from the build. I've described my findings so far below. Does this idea seem reasonable? If so, is there a preferred way to omit the webworker-threads module from the build?
Findings
Here's the dependency chain I'm seeing:
spell-check ➡️ spelling-manager ➡️ natural ➡️ webworker-threads ➡️ bindings
I think the issue we're seeing has to due with natural's dependency on webworker-threads. I came across a few other people mentioning issues attempting to use the webworker-threads module with Electron:
The natural module declares webworker-threads as an optionalDependency (NaturalNode/natural#354). If webworker-threads is installed, the natural module attempts to use it [code].
NaturalNode/natural#368 explains that deleting the the webworker-threads module only works on Node, and not on Electron.
NaturalNode/natural#368 goes on to say that you can work around the issue by deleting the
node_modules/webworker-threadsfolder after installing thenaturalmodule. I tried that, and it seems to do the trick. Here's the behavior I'm seeing:cd ~/github/spell-check && apm link && apm installrm -rf ~/github/spell-check/node_modules/webworker-threadsSince that seems to resolve the issue, is there a way that we can teach Atom (or the spell-check package) to not install the webworker-threads module?
One (super hacky) option might be to add a post-install hook on the spell-check package to delete the webworker-threads module. For example, imagine something like this, but tweaked to run in a cross-platform manner:
maxbrunsfeld commentedon Apr 11, 2018
👍 Yeah that seems worth a try.
dmoonfire commentedon Apr 11, 2018
That is reasonable. Likewise, I can also work to get rid of
naturalfromspelling-managersince I was just using it for easy tokenization.annthurium commentedon Apr 11, 2018
@jasonrudolph I am also able to reproduce it sometimes but not every time. I'll grab a stack trace next time I encounter it. is there any other debug output that would be helpful that I could try to capture?
jasonrudolph commentedon Apr 11, 2018
@maxbrunsfeld @dmoonfire: Thank you! I'll give this approach a shot in #244.
@annthurium: I can't think of any additional debug output to capture. If I think of any, I'll definitely let you know. 🙇
Use fork of spelling-manager module that omits webworker-threads
jasonrudolph commentedon Apr 13, 2018
The problem seen in #67 (comment) should be resolved by #246. That fix is included in Atom 1.26-beta2 (released today) and will be part of Atom 1.26 stable when it is released.
I'm going to close this issue. If you're using Atom 1.26-beta2 (or newer) and you continue to see this problem, please open a new issue to let us know.