Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Builds failing on Windows due to pathing issues #127

Closed
Skaiir opened this issue Jan 7, 2022 · 2 comments · Fixed by #128
Closed

Builds failing on Windows due to pathing issues #127

Skaiir opened this issue Jan 7, 2022 · 2 comments · Fixed by #128
Assignees
Labels
bug Something isn't working

Comments

@Skaiir
Copy link
Contributor

Skaiir commented Jan 7, 2022

Describe the Bug

On Windows specifically, the package cannot be built at all, as multiple modules relating to preact cannot be resolved.

ERROR in ./preact/hooks/dist/hooks.module.js 1:0-37
Module not found: Error: Can't resolve '....' in 'C:\dev\bpmn-io\properties-panel\properties-panel\preact\hooks\dist'
 @ ./src/PropertiesPanel.js 1:0-54 84:30-38 85:2-11
 @ ./test/spec/PropertiesPanel.spec.js 5:0-50 258:21-36
 @ ./test/ sync .spec\.js$ ./spec/PropertiesPanel.spec.js test/spec/PropertiesPanel.spec.js
 @ ./test/testBundle.js 1:17-57

Steps to Reproduce

  1. Clone the repo on a Windows machine
  2. Execute npm install
  3. Execute npm run dev

Expected Behavior

We expect the build to complete without errors.

Environment

  • Host: Node v14
  • OS: Window 10
  • Library version: 0.10.0
@Skaiir Skaiir added the bug Something isn't working label Jan 7, 2022
@marstamm
Copy link
Contributor

marstamm commented Jan 7, 2022

Hypothesis: in the rewire step, Windows paths are not properly escaped. Cf.

function rewirePreactSubpackages() {
return {
async buildEnd() {
await replaceInFile({
files: './preact/**/*.{js,mjs,js.map}',
from: [ /(import\s*['"])preact([/'"])/g, /(from\s*['"])preact([/'"])/g, /(require\(['"])preact([/'"])/g ],
to: function(...args) {
const importGroup = args[1],
afterImport = args[2],
filePath = args.pop();
const { dir } = parsePath(filePath);
const pathToPreact = relativePath(dir, './preact');
return `${importGroup}${pathToPreact}${afterImport}`;
}
});
}
};
}

I can't test it on windows right now

@marstamm
Copy link
Contributor

marstamm commented Jan 7, 2022

Let's also consider adding Windows + Mac as additional OS on CI
https://github.com/bpmn-io/properties-panel/blob/main/.github/workflows/CI.yml

@marstamm marstamm added the ready Ready to be worked on label Jan 7, 2022
@bpmn-io-tasks bpmn-io-tasks bot added in progress Currently worked on and removed ready Ready to be worked on labels Jan 7, 2022
@bpmn-io-tasks bpmn-io-tasks bot added needs review Review pending and removed in progress Currently worked on labels Jan 7, 2022
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Jan 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants