GithubHelp home page GithubHelp logo

Comments (6)

taboularasa avatar taboularasa commented on May 5, 2024 1

@gauravtiwari thanks for following up. I just tested the repo steps on a new rails project and can confirm that this is no longer an issue

from webpacker.

joerodrig avatar joerodrig commented on May 5, 2024

It looks like this is being caused by the require statement in the hello_angular.js file that's being generated at line 7. I was able to get the app to compile by moving the require statement to application.js and changing it to an import statement.
ie. import HelloAngular from "./hello_angular". You can see in the React example, the file loads a component, whereas this one seems to be requiring itself.

from webpacker.

taboularasa avatar taboularasa commented on May 5, 2024

@joerodrig3 thanks for taking some time to look at this! Thats a good observation you made about hello_angular.js:7 requiring itself, I don't understand what the intention is there. I was able to reproduce your suggested fix by removing the require to application.js that does allow bin/rake webpacker:compile to succeed but that's also just a noop, the app is never actually booted. application.js is then requiring an empty file. The other curious detail is the app does successfully run locally without any modification via bin/webpack-watcher

I think I'll look at some other Angular 2 / webpack examples and see how it's being done there.

from webpacker.

mikerob215 avatar mikerob215 commented on May 5, 2024

Ran into this issue in a work project with our own webpack integration. The issue is that when you use ts-loader, and compile using webpack --json, the output will contain that string that caused the error in the op and then the JSON that the webpack:compile rake task is looking for. I've had this also happen with awesome-typescript-loader, I'm not sure what other loaders could cause this. I've submitted a pr that will cause the rake task to ignore any string that precedes the JSON it is looking for. #85

from webpacker.

gauravtiwari avatar gauravtiwari commented on May 5, 2024

Does this work now @taboularasa? There has been some updates lately, which I think fixes this problem. Please close this issue if it does :)

from webpacker.

gauravtiwari avatar gauravtiwari commented on May 5, 2024

Awesome 🎉 Have some 🍰

from webpacker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.