fulls1z3 / ngx-meta

Dynamic page title & meta tags utility for Angular (w/server-side rendering)
MIT License
333 stars 47 forks source link

compilation failing with files not found #147

Closed Chuvisco88 closed 6 years ago

Chuvisco88 commented 6 years ago

I'm submitting a ... (check one with "x")

[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  <!-- Please check the repository for a similar issue or PR before submitting -->
[ ] Support request => <!-- Please check the repository for a similar issue or PR before submitting -->
[ ] Feature request
[ ] Documentation issue or request

Current behavior IMPORTANT: @ngx-meta/core version 2.0.1 When compilation is run, it throws an error that a file could not be found when resolving the module

resolve '@ngx-meta/core/index' in 'compiled/src/app'
  Parsed request is a module
  using description file: package.json (relative path: ./compiled/src/app)
    Field 'browser' doesn't contain a valid alias configuration
  after using description file: package.json (relative path: ./compiled/src/app)
    resolve as module
      looking for modules in node_modules
        using description file: package.json (relative path: ./node_modules)
          Field 'browser' doesn't contain a valid alias configuration
        after using description file: package.json (relative path: ./node_modules)
          using description file: node_modules/@ngx-meta/core/package.json (relative path: ./index)
            no extension
              Field 'browser' doesn't contain a valid alias configuration
              node_modules/@ngx-meta/core/index doesn't exist
            .ts
              Field 'browser' doesn't contain a valid alias configuration
              node_modules/@ngx-meta/core/index.ts doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
              node_modules/@ngx-meta/core/index.js doesn't exist
            .json
              Field 'browser' doesn't contain a valid alias configuration
              node_modules/@ngx-meta/core/index.json doesn't exist
            as directory
              node_modules/@ngx-meta/core/index doesn't exist

I tried and added the file from this repository to the node_modules folder, it worked until it didn't find another file node_modules/@ngx-meta/core/src/meta.helper. So I added it as well, tried again until I have added all the missing files. I am wondering why those are not published in the npm package?

Expected/desired behavior The compiler should find the respective file(s) and compile the project. Therefore the files needs to be in the npm package.

Minimal reproduction of the problem with instructions

Run npm install --save @ngx-meta/core@2.0.1 The installed node_module does not contain code files, only definition files.

What is the motivation / use case for changing the behavior? The project previously used @nglibs/meta but couldn't find the repo anymore as it was renamed. So I wanted to point to the renamed repository, which now let's the build fail.

Environment

fulls1z3 commented 6 years ago

@Chuvisco88 i see what the problem exactly is, that's all about we had to change the build system after Angular team forced all libs to do so, and as a drawback projects with Angular <4 are suffering.

Did you try to download the latest package of @ngx-meta/core to an empty project and copy those files from there, to your app's node_modules directory?

Chuvisco88 commented 6 years ago

We found an easy fix by using git instead of the npm module: "ngx-meta": "git+https://github.com/fulls1z3/ngx-meta.git#v2.0.1", That worked as it clones the repo in the node_module folder