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.

next dev constantly errors when using emacs, failing to load emacs lock files

See original GitHub issue

Bug report

When using next dev with emacs, as you develop, emacs creates symbolic link files starting with .# as lock files. Next.js seems to attempt to load these but fails, spewing out errors constantly.

To Reproduce

  1. Run next dev
  2. Develop your .js files using emacs
  3. Observe errors like:
(node:13646) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, stat '/home/lacker/twitroid/pages/.#app.js'
(node:13646) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:13646) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Expected behavior

I expected to not get these errors

System information

  • OS: Ubuntu 18
  • Version of Next.js: 9.4.4
  • Version of Node.js: 10.21.0

Additional context

I tried adding a webpack ignore filter to ignore these files, but it did not have any effect.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
Mstrodlcommented, Nov 3, 2020

This is still an issue, disabling lockfiles for emacs is not a good fix for this at all.

3reactions
lackercommented, Jul 17, 2020

A couple other notes that might help - I saw that create-react-app had a similar issue recently at https://github.com/facebook/create-react-app/issues/9056 . The workaround there of putting (setq create-lockfiles nil) in your .emacs file does work to suppress the errors, but it does so by having emacs no longer create lock files, which is dangerous because then emacs and git will overwrite each others’ changes without emacs noticing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Emacs Lisp error at init (file-error "Cannot open load file ...
el . This is being loaded because you've put usr/local/share/emacs/site-lisp in load-path (several times) and it presumably has bogons on it.
Read more >
how to get Emacs to locate the error in my init file without ...
If turning on debug-on-error and using option --debug-init doesn't help, then do this: Bisect your init file recursively, to locate the tiny ...
Read more >
Interlocking (GNU Emacs Manual)
A lock file cannot be written in some circumstances, e.g., if Emacs lacks the system permissions or cannot create lock files for some...
Read more >
2.7. Using Emacs as a Development Environment
Language-dependent syntax highlighting and indentation. Completely customizable. You can compile and debug programs within Emacs. On a compilation error, you ...
Read more >
What's New In Emacs 24.4
Emacs can now be compiled with file notification support. This happens by default if a suitable system library is found at build time....
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