Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

module.exports = ./../... @ dist/server.js throws Unexpected token . #1029

@denkan

Description

@denkan

Bug Report

What is the expected behavior?

/dist/server.js run without errors.

What is the current behavior?

Throws error "SyntaxError: Unexpected token ." on this generated row:

module.exports = ./../../frontend/website/node_modules/webpack/buildin/module.js;

What modules are related to this issue?

- [ ] aspnetcore-engine
- [ ] common
- [x] express-engine
- [ ] hapi-engine
- [x] module-map-ngfactory-loader

Minimal reproduction with instructions:

I can't reproduce the error from e.g. universal-starter. The same line doesn't get generated from there :(

What is the use-case or motivation for changing an existing behavior?

See comments in last question.

Environment:

@nguniversal versions

  • express-engine: 6.0.0
  • module-map-ngfactory-loader: 6.0.0
Angular CLI: 6.0.8
Node: 8.10.0
OS: darwin x64
Angular: 6.0.5
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.6.8
@angular-devkit/build-angular     0.6.8
@angular-devkit/build-optimizer   0.6.8
@angular-devkit/core              0.6.8
@angular-devkit/schematics        0.6.8
@angular/cdk                      6.0.0
@angular/cli                      6.0.8
@angular/material                 6.0.0
@ngtools/webpack                  6.0.8
@schematics/angular               0.6.8
@schematics/update                0.6.8
rxjs                              6.2.1
typescript                        2.7.2
webpack                           4.8.3

Is there anything else we should know?

I realize this might not be an Angular/Universal issue, really. But I've been searching the web for hours to find any clues on this and I'm just simply stuck. Need to elaborate some thoughts.

Like...

  1. I've never seen this export syntax, using the file path without require(). Is it valid? In what ES-syntax or NodeJS version (maybe I'm using wrong)?

  2. If I change the line to one of the following, the server starts without errors:

module.exports = require('webpack/buildin/module.js');
module.exports = require('./../../../frontend/website/node_modules/webpack/buildin/module.js');

Again - is the generated syntax valid?
The second line works with an additional '../'. Is the generated path incorrect or has this new bare-path-syntax different relative path than e.g. require()?

Any thoughts is appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    need: repro stepsWe cannot reproduce the issue with the information given

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions