next dev constantly errors when using emacs, failing to load emacs lock files
See original GitHub issueBug 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
- Run
next dev
- Develop your
.js
files using emacs - 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:
- Created 3 years ago
- Comments:9 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is still an issue, disabling lockfiles for emacs is not a good fix for this at all.
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.