Closed peter-at-work closed 1 year ago
Thanks for the report and the associated analysis - it helps a lot!
A fix for this is out in the preview and will be included in the 1.2.0
release coming this week. In the meantime you can use the next
version.
Bug Report
For more information, see the
CONTRIBUTING
guide.Prerequisites
Environment Details and Version
Description
After setting up a new piral instance, and building the repo (to build the emulator and the distribution), the build returns an error, not being able to find dependencies/modules.
Steps to Reproduce
Expected behavior
The emulator and distribution bundles get built.
Actual behavior
The following errors are presented:
Possible Origin/Solution
First attempt of setting webpack configuration to set preferRelative did not fix the problem.
In the piral-core codegen module, it looks like the import statements are being generated with the relative paths of the dependencies like react, react-dom, etc. The relative paths are generated using the platform path separator (backslash in windows). Since these relative paths are to be used in import statements, they should be normalized back to the posix/slash path separator and nodejs would process the path correctly, regardless of the platform.
https://github.com/smapiot/piral/blob/11a570fc7fbacb6c663f4a614d976730cb8d69be/src/framework/piral-core/src/tools/codegen.ts#L69-L70