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.

Bug: It doesn't work with windows

See original GitHub issue

ESBuild seems to fail to install h5OJ8sj0 As seen, there is no binary. Config: https://sourceb.in/BSbso4rW2k

node:events:368
      throw er; // Unhandled 'error' event
      ^

Error: spawn C:\Users\milo5\Desktop\GitHub\website\node_modules\@contentlayer\core\node_modules\esbuild\bin\esbuild ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
    at onErrorNT (node:internal/child_process:477:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (node:internal/child_process:288:12)
    at onErrorNT (node:internal/child_process:477:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn C:\\Users\\milo5\\Desktop\\GitHub\\website\\node_modules\\@contentlayer\\core\\node_modules\\esbuild\\bin\\esbuild',
  path: 'C:\\Users\\milo5\\Desktop\\GitHub\\website\\node_modules\\@contentlayer\\core\\node_modules\\esbuild\\bin\\esbuild',

And that’s the error. More context: W50T6c9o pIwf251L oMcfVoOW juwFr8sx

Next.config.js

const { withContentlayer } = require('next-contentlayer');

/**
 * @type {import('next').NextConfig}
 */
module.exports = withContentlayer()({
	reactStrictMode: true,
	async headers() {
		return [
			{
				source: '/(.*)',
				headers: securityHeaders,
			},
		];
	},
	webpack: (config, { dev, isServer }) => {
		// Replace React with Preact only in client production build
		if (!dev && !isServer) {
			Object.assign(config.resolve.alias, {
				react: 'preact/compat',
				'react-dom': 'preact/compat',
			});
		}

		return config;
	},
});

// https://securityheaders.com
const ContentSecurityPolicy = `
  default-src 'self';
  script-src 'self' 'unsafe-eval' 'unsafe-inline' *.youtube.com *.twitter.com cdn.usefathom.com;
  child-src *.youtube.com *.google.com *.twitter.com;
  style-src 'self' 'unsafe-inline' *.googleapis.com;
  img-src * blob: data:;
  media-src 'none';
  connect-src *;
  font-src 'self';
`;

const securityHeaders = [
	// https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
	{
		key: 'Content-Security-Policy',
		value: ContentSecurityPolicy.replace(/\n/g, ''),
	},
	// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy
	{
		key: 'Referrer-Policy',
		value: 'origin-when-cross-origin',
	},
	// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
	{
		key: 'X-Frame-Options',
		value: 'DENY',
	},
	// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options
	{
		key: 'X-Content-Type-Options',
		value: 'nosniff',
	},
	// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-DNS-Prefetch-Control
	{
		key: 'X-DNS-Prefetch-Control',
		value: 'on',
	},
	// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security
	{
		key: 'Strict-Transport-Security',
		value: 'max-age=31536000; includeSubDomains; preload',
	},
	// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy
	// Opt-out of Google FLoC: https://amifloced.org/
	{
		key: 'Permissions-Policy',
		value: 'camera=(), microphone=(), geolocation=(), interest-cohort=()',
	},
];

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
schicklingcommented, Nov 8, 2021
4reactions
schicklingcommented, Nov 4, 2021

@AkashRajpurohit I’ve released a preview version with Windows support. You can try installing it via yarn add contentlayer@0.0.28-dev.12 next-contentlayer@0.0.28-dev.12. I’ll release a stable version soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Windows Explorer has stopped working
Outdated or corrupt video drivers can cause Windows Explorer to stop working. Downloading and installing the latest video driver can solve many of...
Read more >
Get help with Windows activation errors - Microsoft Support
Learn how to troubleshoot Windows activation errors. Browse common activation errors and learn what you can do to fix them.
Read more >
Troubleshoot problems updating Windows - Microsoft Support
Learn how to troubleshoot problems updating Windows. Find answers to common questions and issues installing Windows updates.
Read more >
Fix Windows Update errors - Microsoft Support
The steps in this guided walk-through should help with all Windows Update errors and other issues—you don't need to search for the specific...
Read more >
Fix problems in Windows Search - Microsoft Learn
If Windows Search is unresponsive or the search results don't appear as expected, try any of the following solutions in this article.
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