Skip to content

Commit

Permalink
Merge pull request #159 from StatTag/revert-158-Refactor/Abhijay007-W…
Browse files Browse the repository at this point in the history
…ebpackFileError

Revert "(Fix) : Fixed [Webpack] configuration to handle .cs files"
  • Loading branch information
lrasmus authored Feb 12, 2024
2 parents a1e47a5 + 8efae93 commit bd497a3
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,27 @@ yarn package

## Build Issues

There are some potential build issues that we need to fix long-term, but have temporary workarounds.
There are some potential build issues that we need to fix long-term, but have temporary workarounds. If after running `yarn install` you get an error:

```
ERROR in ./node_modules/node-gyp/lib/Find-VisualStudio.cs 9:6
Module parse failed: Unexpected token (9:6)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| // This script needs to be compatible with PowerShell v2 to run on Windows 2008R2 and Windows 7.
|
> using System;
| using System.Text;
| using System.Runtime.InteropServices;
@ ./node_modules/node-gyp/lib/ sync ^\.\/.*$ ./Find-VisualStudio.cs
@ ./node_modules/node-gyp/lib/node-gyp.js 41:13-36 195:36-53
@ ./node_modules/@electron/rebuild/lib/src/module-type/node-gyp.js 9:35-54
@ ./node_modules/@electron/rebuild/lib/src/module-rebuilder.js 34:19-52
@ ./node_modules/@electron/rebuild/lib/src/rebuild.js 38:27-56
@ ./node_modules/@electron/rebuild/lib/src/main.js 4:18-38
@ dll renderer renderer[0]
```

You will need to manually remove the file `./node_modules/node-gyp/lib/Find-VisualStudio.cs`, then re-run `yarn install`. We'll work on finding a long-term fix for this.

If when building/packaging you get the following error:

Expand Down
2 changes: 1 addition & 1 deletion configs/webpack.config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default {
module: {
rules: [
{
test: /\.(jsx?|cs)$/,
test: /\.jsx?$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
Expand Down
9 changes: 9 additions & 0 deletions internals/scripts/CheckYarn.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,12 @@ if (!/yarn\.js$/.test(process.env.npm_execpath || '')) {
"\u001b[33mYou don't seem to be using yarn. This could produce unexpected results.\u001b[39m"
);
}

// We have experienced this issue for some time with this file and our setup not behaving. The
// best solution discovered is to remove the file. Not great, but if it works, we'll do it.
// TODO - Eventually figure out what's really going on, see if we can update the stack to resolve
// this, or something else.
const problemFile = './node_modules/node-gyp/lib/Find-VisualStudio.cs';
if (fs.existsSync(problemFile)) {
fs.unlinkSync(problemFile);
}

0 comments on commit bd497a3

Please sign in to comment.