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

[Windows] - "bare" example fails to build - (angular-scss-compiler) #1907

Open
shberko opened this issue Apr 17, 2018 · 5 comments
Open

[Windows] - "bare" example fails to build - (angular-scss-compiler) #1907

shberko opened this issue Apr 17, 2018 · 5 comments

Comments

@shberko
Copy link

shberko commented Apr 17, 2018

Hi,

When I try to build the example project, I get an error with angular-compilers/angular-scss-compiler.
meteor version: 1.6.1.1
running on windows 10

build output:
[client]: ES2015 modules Compilation: 127226.499ms AoT Code Generator Created.: 10888.140ms NgModules Loaded.: 0.184ms [client]: HTML Files Compilation: 21.022ms / [client]: SCSS Files Compilation: 25.791ms / [server]: ES2015 modules Compilation: 3616.914ms AoT Code Generator Created.: 1110.458ms NgModules Loaded.: 0.055ms Modules Analyzed.: 747.574ms Generating Modules.: 420.967ms Modules Converted to TypeScript.: 0.112ms [server]: TypeScript Files Compilation: 2100.689ms [server]: HTML Files Compilation: 0.029ms - Errors prevented bundling: While processing files with angular-compilers (for target web.browser): C:\Users\MyPC\AppData\Local\.meteor\packages\angular-compilers\0.3.1_2\plugin.Angular_Compilers.os\npm\node_modules\meteor\angular-scss-compiler\node_modules\node-sass\lib\index.js:439:16: File to read not found or unreadable: C:/Users/MyPC/WebstormProjects/angular-meteor-full-package/examples/MeteorCLI/bare/C:/Users/MyPC/WebstormProjects/angular-meteor-full-package/examples/MeteorCLI/bare/client/imports/app/todo-list/todo-list.scss at Object.module.exports.renderSync (C:\Users\MyPC\AppData\Local\.meteor\packages\angular-compilers\0.3.1_2\plugin.Angular_Compilers.os\npm\node_modules\meteor\angular-scss-compiler\node_modules\node-sass\lib\index.js:439:16) at Function.compileFile (packages/angular-scss-compiler/index.js:28:17) at TsCompilerAotCompilerTypeCheckHostAdapter.compiler._host.loadResource.filePath (packages/angular-typescript-compiler/index.js:353:38) at Object.get (C:\Users\MyPC\WebstormProjects\angular-meteor-full-package\examples\MeteorCLI\bare\node_modules\packages\compiler\esm5\src\aot\compiler_factory.js:78:306) at DirectiveNormalizer._fetch (C:\Users\MyPC\WebstormProjects\angular-meteor-full-package\examples\MeteorCLI\bare\node_modules\packages\compiler\esm5\src\directive_normalizer.js:95:7) at C:\Users\MyPC\WebstormProjects\angular-meteor-full-package\examples\MeteorCLI\bare\node_modules\packages\compiler\esm5\src\directive_normalizer.js:292:36 at Array.map (<anonymous>) at DirectiveNormalizer._loadMissingExternalStylesheets (C:\Users\MyPC\WebstormProjects\angular-meteor-full-package\examples\MeteorCLI\bare\node_modules\packages\compiler\esm5\src\directive_normalizer.js:291:14) at DirectiveNormalizer._normalizeTemplateMetadata (C:\Users\MyPC\WebstormProjects\angular-meteor-full-package\examples\MeteorCLI\bare\node_modules\packages\compiler\esm5\src\directive_normalizer.js:201:7) at C:\Users\MyPC\WebstormProjects\angular-meteor-full-package\examples\MeteorCLI\bare\node_modules\packages\compiler\esm5\src\directive_normalizer.js:127:7 at Object.then (C:\Users\MyPC\WebstormProjects\angular-meteor-full-package\examples\MeteorCLI\bare\node_modules\packages\compiler\esm5\src\util.js:171:3) at DirectiveNormalizer.normalizeTemplate (C:\Users\MyPC\WebstormProjects\angular-meteor-full-package\examples\MeteorCLI\bare\node_modules\packages\compiler\esm5\src\directive_normalizer.js:127:7) at CompileMetadataResolver.loadDirectiveMetadata (C:\Users\MyPC\WebstormProjects\angular-meteor-full-package\examples\MeteorCLI\bare\node_modules\packages\compiler\esm5\src\metadata_resolver.js:363:44) at C:\Users\MyPC\WebstormProjects\angular-meteor-full-package\examples\MeteorCLI\bare\node_modules\packages\compiler\esm5\src\metadata_resolver.js:620:54 at Array.forEach (<anonymous>) at CompileMetadataResolver.loadNgModuleDirectiveAndPipeMetadata (C:\Users\MyPC\WebstormProjects\angular-meteor-full-package\examples\MeteorCLI\bare\node_modules\packages\compiler\esm5\src\metadata_resolver.js:619:16) at C:\Users\MyPC\WebstormProjects\angular-meteor-full-package\examples\MeteorCLI\bare\node_modules\packages\compiler\esm5\src\aot\compiler.js:91:7 at Array.map (<anonymous>) at AotCompiler.analyzeModulesAsync (C:\Users\MyPC\WebstormProjects\angular-meteor-full-package\examples\MeteorCLI\bare\node_modules\packages\compiler\esm5\src\aot\compiler.js:91:7) at Promise.asyncApply (packages/angular-typescript-compiler/index.js:368:42) at C:\Users\MyPC\AppData\Local\.meteor\packages\meteor-tool\1.6.1_1\mt-os.windows.x86_64\dev_bundle\lib\node_modules\meteor-promise\fiber_pool.js:43:40

As you can see above, the path that it's using to lookup the css file, is corrupt. In the middle of the path it goes back to "C:" and starts again: C:/Users/MyPC/WebstormProjects/angular-meteor-full-package/examples/MeteorCLI/bare/C:/Users/MyPC/WebstormProjects/angular-meteor-full-package/examples/MeteorCLI/bare/client/imports/app/todo-list/todo-list.scss

I've tried with the other example projects as well, and they all give me the same error.
Thanks.

@ardatan ardatan changed the title "bare" example fails to build - (angular-scss-compiler) [Windows] - "bare" example fails to build - (angular-scss-compiler) May 9, 2018
@Klimm-Max
Copy link

i think this is related to the AOT building since i can run the projects with the meteor command.
please give some information about your build process/command.

@ziben
Copy link

ziben commented Oct 11, 2018

I have meet the same problem!

Any progress on it?

@araad
Copy link
Contributor

araad commented Jan 31, 2019

I'm having the same issue on windows 10, but it works fine on linux.
using meteor 1.8.0.2

@araad
Copy link
Contributor

araad commented Jan 31, 2019

The issue seems to be caused by file paths containing "/" instead of "\"
e.g: C:/myApp/client/imports/app/todo-list.scss

The part of the code that is causing the error is shown below found in two files angular-scss-compiler/file-utils.js and angular-typescript-compiler/file-utils.js:

export const basePath = process.cwd();

export function getMeteorPath(filePath) {
  if (filePath.startsWith(basePath)) {
    filePath = filePath.slice(basePath.length);
  }
  return getNoRooted(filePath);
}

process.cwd() returns a file path using the correct Windows separator "\"
so filePath.startsWith(basePath) will always return false

To fix this I used a local copy of the packages and modified both files above to include the following:

export const basePath = process.cwd().replace(/\\/g, '\/');

Tested on Ubuntu 16.04 and Windows 10

This issue was also mentioned in #1895

@AlexSterk
Copy link

I still have this issue, despite being on 0.3.4:

Errors prevented bundling:
While processing files with angular-compilers (for target web.browser):
C:\Users\ajh\AppData\Local\.meteor\packages\angular-compilers\0.3.4\plugin.Angular_Compilers.os\npm\node_modules\meteor\angular-scss-compiler\node_modules\node-sass\lib\index.js:439:16: File to read not found or unreadable: C:/Users/ajh/PHPProjects/morse-2/C:/Users/ajh/PHPProjects/morse-2/client/imports/app/player/parts/interrupt/interrupt.scss
at Object.module.exports.renderSync (C:\Users\ajh\AppData\Local\.meteor\packages\angular-compilers\0.3.4\plugin.Angular_Compilers.os\npm\node_modules\meteor\angular-scss-compiler\node_modules\node-sass\lib\index.js:439:16)
at Function.compileFile (packages/angular-scss-compiler/index.js:28:17)
at TsCompilerAotCompilerTypeCheckHostAdapter.compiler._host.loadResource.filePath (packages/angular-typescript-compiler/index.js:344:38)
at Object.get (C:\Users\ajh\PHPProjects\packages\compiler\src\aot\compiler_factory.ts:84:43)
at DirectiveNormalizer._fetch (C:\Users\ajh\PHPProjects\packages\compiler\src\directive_normalizer.ts:58:37)
at C:\Users\ajh\PHPProjects\packages\compiler\src\directive_normalizer.ts:223:40
at Array.map (<anonymous>)
at DirectiveNormalizer._loadMissingExternalStylesheets (C:\Users\ajh\PHPProjects\packages\compiler\src\directive_normalizer.ts:221:28)
at DirectiveNormalizer._normalizeTemplateMetadata (C:\Users\ajh\PHPProjects\packages\compiler\src\directive_normalizer.ts:154:14)
at C:\Users\ajh\PHPProjects\packages\compiler\src\directive_normalizer.ts:93:37
at Object.then (C:\Users\ajh\PHPProjects\packages\compiler\src\util.ts:89:74)
at DirectiveNormalizer.normalizeTemplate (C:\Users\ajh\PHPProjects\packages\compiler\src\directive_normalizer.ts:91:22)
at CompileMetadataResolver.loadDirectiveMetadata (C:\Users\ajh\PHPProjects\packages\compiler\src\metadata_resolver.ts:260:54)
at C:\Users\ajh\PHPProjects\packages\compiler\src\metadata_resolver.ts:468:30
at Array.forEach (<anonymous>)
at CompileMetadataResolver.loadNgModuleDirectiveAndPipeMetadata (C:\Users\ajh\PHPProjects\packages\compiler\src\metadata_resolver.ts:467:35)
at C:\Users\ajh\PHPProjects\packages\compiler\src\aot\compiler.ts:84:48
at Array.map (<anonymous>)
at AotCompiler.analyzeModulesAsync (C:\Users\ajh\PHPProjects\packages\compiler\src\aot\compiler.ts:83:38)
at Promise.asyncApply (packages/angular-typescript-compiler/index.js:359:42)
at C:\Users\ajh\AppData\Local\.meteor\packages\meteor-tool\1.8.1\mt-os.windows.x86_64\dev_bundle\lib\node_modules\meteor-promise\fiber_pool.js:43:40


While processing files with angular-compilers (for target web.browser.legacy):
C:\Users\ajh\AppData\Local\.meteor\packages\angular-compilers\0.3.4\plugin.Angular_Compilers.os\npm\node_modules\meteor\angular-scss-compiler\node_modules\node-sass\lib\index.js:439:16: File to read not found or unreadable: C:/Users/ajh/PHPProjects/morse-2/C:/Users/ajh/PHPProjects/morse-2/client/imports/app/player/parts/interrupt/interrupt.scss
at Object.module.exports.renderSync (C:\Users\ajh\AppData\Local\.meteor\packages\angular-compilers\0.3.4\plugin.Angular_Compilers.os\npm\node_modules\meteor\angular-scss-compiler\node_modules\node-sass\lib\index.js:439:16)
at Function.compileFile (packages/angular-scss-compiler/index.js:28:17)
at TsCompilerAotCompilerTypeCheckHostAdapter.compiler._host.loadResource.filePath (packages/angular-typescript-compiler/index.js:344:38)
at Object.get (C:\Users\ajh\PHPProjects\packages\compiler\src\aot\compiler_factory.ts:84:43)
at DirectiveNormalizer._fetch (C:\Users\ajh\PHPProjects\packages\compiler\src\directive_normalizer.ts:58:37)
at C:\Users\ajh\PHPProjects\packages\compiler\src\directive_normalizer.ts:223:40
at Array.map (<anonymous>)
at DirectiveNormalizer._loadMissingExternalStylesheets (C:\Users\ajh\PHPProjects\packages\compiler\src\directive_normalizer.ts:221:28)
at DirectiveNormalizer._normalizeTemplateMetadata (C:\Users\ajh\PHPProjects\packages\compiler\src\directive_normalizer.ts:154:14)
at C:\Users\ajh\PHPProjects\packages\compiler\src\directive_normalizer.ts:93:37
at Object.then (C:\Users\ajh\PHPProjects\packages\compiler\src\util.ts:89:74

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants