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.

Ember hangs on JavaScript syntax error

See original GitHub issue

ember server stuck on “building… [Babel: project > applyPatches]” this happens when a JavaScript syntax error

I have created a new project and I’m getting the same problem things I tried to do:

  1. delete watchman
  2. reinstall package.json
  3. upgrade to newer version
  4. delete package-lock.json and node_module and reinstall
  5. update nodejs, update npm

and nothing work, this problem started when I did “npm update” , my old projects still working but the new ones are not

ember: 3.28.5 node: 14.19.1 npm: 6.14.16

I’m using nodenv for nodejs

and this is the last few lines of debug log

 ember-auto-import:analyzer updating imports for secondproject/components/upload-fi/component.js, 179 +1m
  ember-auto-import:analyzer Ignoring an unparseable file +10ms
  broccoli-persistent-filter:Babel > [Babel: secondproject] [Babel: secondproject#3162 -> derivePatches#3163] found 0 files invalidated due to dependency changes. +13ms
  fs-tree-diff: [Babel: secondproject#3162 -> derivePatches#3163] invalidation reason: 
  fs-tree-diff: before Entry { relativePath: 'secondproject/components/upload-fi/component.js', basePath: '/tmp/broccoli-2028251l6a6zVNzKjEG/out-266-analyzer_ember_auto_import_analyzer', mode: 33204, size: 176, mtime: 1648093444681 }
  fs-tree-diff:  entryB Entry { relativePath: 'secondproject/components/upload-fi/component.js', basePath: '/tmp/broccoli-2028251l6a6zVNzKjEG/out-266-analyzer_ember_auto_import_analyzer', mode: 33204, size: 179, mtime: 1648093517521 } +0ms
  broccoli-persistent-filter:Babel > [Babel: secondproject] [Babel: secondproject#3162 -> derivePatches#3163] derivePatches duration: 2.03 ms {"patches":1,"entries":54,"invalidations":{"dependencies":0,"count":0,"duration":"0.16 ms"},"walk":{"entries":54,"duration":"1.35 ms"}} +0ms
  async-promise-queue: started, with concurrency=3 +1ms
  async-disk-cache get: /tmp/khaled/if-you-need-to-delete-this-open-an-issue-async-disk-cache/60752e0420d2d76e324ee36db6a8377a3f7bb400/37c1f9418ee002127298279720a594fd329cf087 +1ms
⠙ building...   broccoli-persistent-filter:babel:parallel-api [Babel: secondproject#3162 -> applyPatches#3164] transformString is parallelizable +1ms
2022-03-24T03:45:17.555Z babel:config:loading:files:plugins Loaded plugin '/home/khaled/projects/thisIsMy/secondproject/node_modules/babel-plugin-htmlbars-inline-precompile/index.js' from '/home/khaled/projects/thisIsMy/secondproject'.
2022-03-24T03:45:17.556Z babel:config:loading:files:plugins Loaded plugin '/home/khaled/projects/thisIsMy/secondproject/node_modules/ember-cli-htmlbars/lib/colocated-babel-plugin.js' from '/home/khaled/projects/thisIsMy/secondproject'.
2022-03-24T03:45:17.556Z babel:config:loading:files:plugins Loaded plugin '/home/khaled/projects/thisIsMy/secondproject/node_modules/@babel/plugin-proposal-decorators/lib/index.js' from '/home/khaled/projects/thisIsMy/secondproject'.
2022-03-24T03:45:17.556Z babel:config:loading:files:plugins Loaded plugin '/home/khaled/projects/thisIsMy/secondproject/node_modules/@babel/plugin-proposal-private-property-in-object/lib/index.js' from '/home/khaled/projects/thisIsMy/secondproject'.
2022-03-24T03:45:17.556Z babel:config:loading:files:plugins Loaded plugin '/home/khaled/projects/thisIsMy/secondproject/node_modules/@babel/plugin-proposal-private-methods/lib/index.js' from '/home/khaled/projects/thisIsMy/secondproject'.
2022-03-24T03:45:17.556Z babel:config:loading:files:plugins Loaded plugin '/home/khaled/projects/thisIsMy/secondproject/node_modules/@babel/plugin-proposal-class-properties/lib/index.js' from '/home/khaled/projects/thisIsMy/secondproject'.
2022-03-24T03:45:17.556Z babel:config:loading:files:plugins Loaded plugin '/home/khaled/projects/thisIsMy/secondproject/node_modules/babel-plugin-debug-macros/src/index.js' from '/home/khaled/projects/thisIsMy/secondproject'.
2022-03-24T03:45:17.556Z babel:config:loading:files:plugins Loaded plugin '/home/khaled/projects/thisIsMy/secondproject/node_modules/babel-plugin-debug-macros/src/index.js' from '/home/khaled/projects/thisIsMy/secondproject'.
2022-03-24T03:45:17.557Z babel:config:loading:files:plugins Loaded plugin '/home/khaled/projects/thisIsMy/secondproject/node_modules/babel-plugin-module-resolver/lib/index.js' from '/home/khaled/projects/thisIsMy/secondproject'.
2022-03-24T03:45:17.557Z babel:config:loading:files:plugins Loaded plugin '/home/khaled/projects/thisIsMy/secondproject/node_modules/@babel/plugin-transform-modules-amd/lib/index.js' from '/home/khaled/projects/thisIsMy/secondproject'.
2022-03-24T03:45:17.557Z babel:config:loading:files:plugins Loaded preset '/home/khaled/projects/thisIsMy/secondproject/node_modules/@babel/preset-env/lib/index.js' from '/home/khaled/projects/thisIsMy/secondproject'.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:7
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

6reactions
Windviscommented, Mar 31, 2022

@rwjblue To reproduce:

  1. Generate a new Ember app. The version doesn’t matter I tried versions between 3.24 and 4.3.
  2. Start the app
  3. Add a syntax error to a .js file and save it (I used app/app.js)
  4. The process hangs on building... [Babel: project > applyPatches]

It also hangs when starting the app if it already has a syntax error somewhere so it’s not limited to rebuilds only.

Forcing the version of @babel/parser to be lower than 7.17.7 “fixes” the problem.

1reaction
benediktcommented, Mar 31, 2022

Running the server with CI=true JOBS=0 ember s doesn’t really change anything. There are no error messages, it just hangs at “building…” until hitting CTRL+C when it changes to “cleaning up…” but still hangs indefinitely.

The only way to recover is killing the process, fixing the syntax error, and starting the server again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JavaScript error handling with Ember.js · Raygun Blog
Any Error or Ember.Error that occurs in one of your callbacks will be picked up by this function. Logger.error provides the context as...
Read more >
build tooling crashes on syntax-error · Issue #34 - GitHub
using ember-cli (like we do in ember) corrects this problem, and also uses a faster/better watcher and exposes ... build tooling crashes on...
Read more >
Ember.js - Error when running ember --version command
... I run ember --version command outside of the app directory it works, but when I run it inside app directory it crashes...
Read more >
Ember UI not loading - Build Issues
Ember UI is not loading on staging env with below error message in the ... I had a problem of a syntax error...
Read more >
The 8 Most Common Mistakes That Ember.js Developers Make
2: Forgetting That Route-driven Controllers Are Singletons. Routes in Ember.js set up properties on controllers that serve as the context for the corresponding ......
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