gandm / language-babel

ES2017, flow, React JSX and GraphQL grammar and transpilation for ATOM
https://atom.io/packages/language-babel
MIT License
476 stars 83 forks source link

Uncaught TypeError: Cannot read property 'code' of undefined #535

Closed cnjimbo closed 4 years ago

cnjimbo commented 4 years ago

[Enter steps to reproduce:]

  1. ..atom's language-babel using babel 7,
  2. .open the Transpile on save
  3. It's working well for the root path's files, but the subdirectory will occur this issue

Atom: 1.45.0 x64 Electron: 4.2.7 OS: Unknown Windows version Thrown From: language-babel package 2.85.0

Stack Trace

Uncaught TypeError: Cannot read property 'code' of undefined

At C:\Users\tangj15\.atom\packages\language-babel\lib\transpiler.coffee:215

TypeError: Cannot read property 'code' of undefined
    at /packages/language-babel/lib/transpiler.coffee:215:65
    at ~/AppData/Local/atom/app-1.45.0/resources/app/static/<embedded>:14:43875
    at ~/AppData/Local/atom/app-1.45.0/resources/app/static/<embedded>:14:43716
    at Function.simpleDispatch (~/AppData/Local/atom/app-1.45.0/resources/app/static/<embedded>:11:1214120)
    at Emitter.emit (~/AppData/Local/atom/app-1.45.0/resources/app/static/<embedded>:11:1215561)
    at ChildProcess.<anonymous> (~/AppData/Local/atom/app-1.45.0/resources/app/static/<embedded>:14:42817)
    at ChildProcess.emit (events.js:182:13)
    at emit (internal/child_process.js:812:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)

Commands

     -0:46.1.0 intentions:highlight (input.hidden-input)
     -0:46 core:save (input.hidden-input)
     -0:16.7.0 intentions:highlight (input.hidden-input)
     -0:16.6.0 core:save (input.hidden-input)

Non-Core Packages

atom-beautify 0.33.4 
atom-ide-definitions 0.3.4 
atom-ide-markdown-service 1.2.4 
atom-ide-outline 1.2.2 
atom-ide-ui 0.13.0 
atom-ide-vue 1.3.1 
atom-live-server-plus 3.0.1 
atom-material-syntax 1.0.8 
atom-material-ui 2.1.3 
atom-ternjs 0.20.0 
atom-typescript 13.5.1 
autocomplete-modules 2.3.0 
autocomplete-paths 2.12.2 
busy-signal 2.0.1 
case-keep-replace 0.6.2 
command-toolbar 1.0.12 
console-command-runner 1.1.0 
copy-path 0.5.1 
debug 0.0.1 
docblockr 0.13.7 
duplicate-line-or-selection 0.9.0 
editorconfig 2.6.0 
emmet 2.4.3 
emmet-jsx-css-modules 1.0.0 
es6-javascript 1.0.0 
file-icons 2.1.40 
gist-it 0.9.2 
git-control 0.9.0 
git-plus 8.7.1 
hey-pane 1.2.0 
highlight-selected 0.17.0 
Hydrogen 2.14.1 
hyperclick 0.0.0 
ide-css 0.3.4 
ide-html 0.6.0 
ide-json 0.2.1 
ide-typescript 0.9.1 
ide-vue 0.1.9 
ide-yaml 0.7.0 
intentions 1.1.5 
js-hyperclick 1.19.0 
js-refactor 0.8.1 
js-refactor-atom 0.10.1 
language-babel 2.85.0 
language-diff 0.7.0 
language-html-babel 0.49.2 
language-postcss 1.3.1 
language-vue 0.26.0 
language-vue-component 0.5.0 
language-vuetify 0.3.0 
linter 2.3.1 
linter-eslint 8.5.5 
linter-ui-default 1.8.1 
local-history 4.3.1 
local-settings 0.4.1 
minimap 4.29.9 
minimap-highlight-selected 4.6.1 
npm-install 4.0.4 
npm-outdated 0.6.0 
npm-plus 0.4.0 
open-in-atom-pkg 1.0.1 
package-sync 1.1.0 
pigments 0.40.2 
prettier-atom 0.59.0 
pretty-json 2.1.2 
project-manager 3.3.8 
quick-log 0.3.1 
refactor 0.11.5 
regex-railroad-diagram 0.19.4 
related 0.3.5 
script 3.25.0 
scroll-sync 0.2.4 
scroll-through-time 0.3.1 
set-syntax 0.4.0 
sort-lines 0.19.0 
source-preview 0.5.3 
Sublime-Style-Column-Selection 1.7.5 
sync-settings 4.3.2 
tab-foldername-index 3.3.1 
teletype 0.13.4 
toggle-quotes 1.1.4 
tree-view-copy-relative-path 1.2.0 
tree-view-git-status 1.5.3 
vue-fmt 0.1.1 
vue-template-beautify 0.1.2 
zentabs 0.8.9 
cnjimbo commented 4 years ago

I think I found the solution to resolve it. 1, Search the babel config to find the only section in Babel.config.json or babel.config.js 2, remove it.

malahaas commented 3 years ago

1, Search the babel config to find the only section in Babel.config.json or babel.config.js 2, remove it.

Can you elaborate? I'm running into this exact same issue, but I don't see either of those files in the language-babel package.

wiryonolau commented 2 years ago

I solve it by putting the .babelrc in same directory of the file that require transpile