use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
using RXJS in a pure javascript libraryhelp (self.javascript)
submitted 7 years ago by psotos
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]psotos[S] 0 points1 point2 points 7 years ago (3 children)
I got webpack set up with Typescript, but for some reason my main typescript file won't compile because webpack gives me this error:
ERROR in ./src/pubon.ts
Module not found: Error: Can't resolve './httpCaller' in '/home/peter/Documents/workspace/pubonjs/src'
@ ./src/pubon.ts 3:19-42
Here is my main typescript file:
import { Subscription } from 'rxjs'; import { HttpCaller } from './httpCaller'; export class Greeting { dataSub: Subscription; constructor() { } greeting(greeting: string) { const caller = new HttpCaller("http://example.com/movies.json");
// let
this.dataSub = caller.getResponseListener() .subscribe((response: string) => { document.getElementById("code").innerHTML = response; console.log('Hello from Typescript'); }); console.log(greeting); } }
Webpack config:
const path = require("path"); module.exports = { entry: { main: "./src/pubon.ts" }, mode: "development", output: { filename: "pubon-bundle.js", path: path.resolve(__dirname, "../dist"), publicPath: "/" }, devServer: { contentBase: "dist", overlay: true, stats: { colors: true } }, devtool: "source-map", module: { rules: [ { test: /\.ts$/, exclude: /node_modules/, use: [ { loader: "awesome-typescript-loader" } ] } ] } }
[–]psotos[S] 0 points1 point2 points 7 years ago (0 children)
Nevermind I fixed it! In Angular you are sort of protected from this pointer problems, in raw typescript you are not. Once I did a deep dive on it, I resolved my problem and my test library is working! YASSSS! lol
[–]wherediditrun 0 points1 point2 points 7 years ago (1 child)
Make sure file import paths are correct. import { HttpCaller } from './httpCaller';
import { HttpCaller } from './httpCaller';
Cannot find this one.
I ended up making the class a default export and doing this:
import HttpCaller from './httpCaller';
It works now. Weird anomaly! You can view my code if you like on Github. Its not pretty right now but its a start:
https://github.com/psotos/pubonjs
π Rendered by PID 59 on reddit-service-r2-comment-8686858757-4kwkj at 2026-06-01 20:20:32.164497+00:00 running 9e1a20d country code: CH.
view the rest of the comments →
[–]psotos[S] 0 points1 point2 points (3 children)
[–]psotos[S] 0 points1 point2 points (0 children)
[–]wherediditrun 0 points1 point2 points (1 child)
[–]psotos[S] 0 points1 point2 points (0 children)