Maybe the relative synchronizer rule is normalizing import paths when it shouldn't? Not sure yet.
examples/store and try to build the store exampleBad character escape sequence errordebug: monorepo
debug: pkgPath: C:\dev\contrib\blitz\node_modules\@blitzjs\cli
Windows 10 | win32-x64 | Node: v12.16.1
blitz: 0.7.0 (global)
blitz: 0.7.1-canary.1 (local)
Creating an optimized production build
Failed to compile.
./app/products/components/ProductForm.tsx
SyntaxError: C:\dev\contrib\blitz\examples\store\.blitz\caches\build\app\products\components\ProductForm.tsx: Bad character escape sequence (4:51)
2 | import {Product, ProductCreateInput, ProductUpdateInput} from 'db'
3 | import createProduct from 'app\products\mutations\createProduct'
> 4 | import updateProduct from 'app\products\mutations\updateProduct'
| ^
5 |
6 | type ProductInput = ProductCreateInput | ProductUpdateInput
7 |
> Build error occurred
Blitz code (examples\store\app\products\components\ProductForm.tsx):
import createProduct from '../mutations/createProduct'
import updateProduct from '../mutations/updateProduct'
Compiled code (examples\store\.blitz\caches\build\app\products\components\ProductForm.tsx):
import createProduct from 'app\products\mutations\createProduct'
import updateProduct from 'app\products\mutations\updateProduct'
The resulting backslashes are incorrect, they should remain forward slashes (in code).
I don't seem to run into this in a newly generated project, but we're still getting the issue reported in #299 so we might just not be making it that far yet? 馃
After some investigation, the relativeToAbsolute function is the culprit. path.sep, process.cwd() and the file's paths are being returned with back slashes.
relative-paths.test.ts's tests are giving a false positive since the path.normalize function replaces forward slashes with back slashes.
Out of my head I can think of avoiding normalizing the paths in test, and replace any back slash with forward slash in relativeToAbsolute using replace. However, I don't yet know the extent of this function in the codebase. Perhaps it would be a better idea to transform on stream's input.
Here is a screenshot of test with some debugging messages on Windows 10:

Most helpful comment
Problem
After some investigation, the
relativeToAbsolutefunction is the culprit.path.sep,process.cwd()and the file's paths are being returned with back slashes.relative-paths.test.ts's tests are giving a false positive since thepath.normalizefunction replaces forward slashes with back slashes.Possible Solution
Out of my head I can think of avoiding normalizing the paths in test, and replace any back slash with forward slash in
relativeToAbsoluteusingreplace. However, I don't yet know the extent of this function in the codebase. Perhaps it would be a better idea to transform on stream's input.Additional Resources
Here is a screenshot of test with some debugging messages on Windows 10: