Meteor Angular2 Tutorial error after adding ui-accounts - javascript

After section 8 (user accounts) in Meteor Angular 2 tutorial (social app) nothing is shown on the browser and in F12 I get this error:
install.js:85 Uncaught Error: Cannot find module 'meteor/accounts-base'require # install.js:85meteorInstall.node_modules.angular2-meteor-accounts-ui.build.login-buttons.js # login-buttons.js:13fileEvaluate # install.js:153require # install.js:82meteorInstall.node_modules.angular2-meteor-accounts-ui.build.index.js # index.js:5fileEvaluate # install.js:153require # install.js:82meteorInstall.client.imports.parties-list.parties-list.js # parties-list.ts:6fileEvaluate # install.js:153require # install.js:82meteorInstall.client.imports.parties-list.parties-list.ts # parties-list.ts:1fileEvaluate # install.js:153require # install.js:82meteorInstall.client.app.js # app.ts:6fileEvaluate # install.js:153require # install.js:82(anonymous function) # parties.ts:22

The referenced meteor/accounts-base module is a direct dependency of the accounts-password package. Step 8 of the Socially - A Meteor-Angular Tutorial App tutorial requires the installation of the accounts-password package, which will in turn install the accounts-base package. Make sure you've run the following:
meteor add accounts-password
To make sure it's installed, look in your .meteor/versions file for a matching accounts-base#X.X.X line.

Related

Module not found: can't resolve '../file'

I am working with an app using electron-vue. In windows, yarn run dev just works fine. But then I decided to switch to Ubuntu 18.04 and now everytime I executed yarn run dev, it returns like this:
ERROR in ./node_modules/iaccs-login/router/OneTimePassword.js
Module not found: Error: Can't resolve '../components/OneTimePassword' in '/mnt/d/iaccs/iaccs-base/node_modules/iaccs-login/router'
# ./node_modules/iaccs-login/router/OneTimePassword.js 4:15-55
# ./src/renderer/router/index.js
# ./src/renderer/main.js
# multi ./.electron-vue/dev-client ./src/renderer/main.js
ERROR in ./node_modules/iaccs-front-office-otc-voucher/router/index.js
Module not found: Error: Can't resolve '../components/OtcVoucher' in '/mnt/d/iaccs/iaccs-base/node_modules/iaccs-front-office-otc-voucher/router'
# ./node_modules/iaccs-front-office-otc-voucher/router/index.js 4:15-50
# ./src/renderer/router/FrontOffice.js
# ./src/renderer/router/index.js
# ./src/renderer/main.js
# multi ./.electron-vue/dev-client ./src/renderer/main.js
ERROR in ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./node_modules/iaccs-front-office-withdrawal/components/Withdrawal.vue
Module not found: Error: Can't resolve '../constants/Withdrawal' in '/mnt/d/iaccs/iaccs-base/node_modules/iaccs-front-office-withdrawal/components'
# ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./node_modules/iaccs-front-office-withdrawal/components/Withdrawal.vue 9:0-92
# ./node_modules/iaccs-front-office-withdrawal/components/Withdrawal.vue
# ./node_modules/iaccs-front-office-withdrawal/router/index.js
# ./src/renderer/router/FrontOffice.js
# ./src/renderer/router/index.js
# ./src/renderer/main.js
# multi ./.electron-vue/dev-client ./src/renderer/main.js
ERROR in ./src/renderer/mixins/Auth.js
Module not found: Error: Can't resolve '../store/Modules' in '/mnt/d/iaccs/iaccs-base/src/renderer/mixins'
# ./src/renderer/mixins/Auth.js 1:12-63
# ./src/renderer/main.js
# multi ./.electron-vue/dev-client ./src/renderer/main.js
ERROR in ./src/renderer/store/index.js
Module not found: Error: Can't resolve './Modules' in '/mnt/d/iaccs/iaccs-base/src/renderer/store'
# ./src/renderer/store/index.js 5:0-32
# ./src/renderer/main.js
# multi ./.electron-vue/dev-client ./src/renderer/main.js
I already checked the files and nothing is missing. Is there something I did wrong?
Thanks!
SOLVED!
It turns out to be a very simple issue. I've been using windows for too long, I forgot that Linux is case-sensitive with the directory and file names. I just renamed my directories and files based on my code and yarn run dev now works!

How to get rid of webpack warnings when including the winston logger using ContextReplacementPlugin?

Running webpack on a project which includes winston, produces a number of warnings (see below). Webpack is automatically including non-javascript files due to a lazy-loading mechanism in a dependency, logform.
You can see what's happening here - see the exposeFormat function: https://github.com/winstonjs/logform/blob/master/index.js
Webpack can't figure out which files to include, so it includes them all, including the README.md files, and attempts to process them with Typescript. I know that webpack's ContextReplacementPlugin should help me, but I can't get it to work.
I've tried adding this to my plugins list in webpack.config.js:
new webpack.ContextReplacementPlugin(/logform/, /(.*)\.js/)
I thought this should include all .js files in the folder. This gets rid of the warnings at build time, but at runtime, I get an error from webpack indicating that an attempt to require one of those files fails.
What am I doing wrong?
Warnings produced by Webpack
WARNING in ./node_modules/logform/index.d.ts
Module build failed: Error: Typescript emitted no output for //Users/aneil/code/project/node_modules/logform/index.d.ts.
You should not need to recompile .ts files in node_modules.
Please contact the package author to advise them to use --declaration --outDir.
More https://github.com/Microsoft/TypeScript/issues/12358
at successLoader (/Users/aneil/code/project/node_modules/ts-loader/dist/index.js:39:15)
at Object.loader (/Users/aneil/code/project/node_modules/ts-loader/dist/index.js:21:12)
# ./node_modules/logform sync ^\.\/.*$
# ./node_modules/logform/index.js
# ./node_modules/winston/lib/winston.js
# ./src/logger.ts
# ./src/services/pipeline/handlers.ts
WARNING in ./node_modules/logform/CHANGELOG.md
Module parse failed: Unexpected character '#' (1:0)
You may need an appropriate loader to handle this file type.
| # CHANGELOG
|
| ### 1.4.2
# ./node_modules/logform sync ^\.\/.*$
# ./node_modules/logform/index.js
# ./node_modules/winston/lib/winston.js
# ./src/logger.ts
# ./src/services/pipeline/handlers.ts
WARNING in ./node_modules/logform/README.md
Module parse failed: Unexpected character '#' (1:0)
You may need an appropriate loader to handle this file type.
| # logform
|
| An mutable object-based log format designed for chaining & objectMode streams.
# ./node_modules/logform sync ^\.\/.*$
# ./node_modules/logform/index.js
# ./node_modules/winston/lib/winston.js
# ./src/logger.ts
# ./src/services/pipeline/handlers.ts
WARNING in ./node_modules/logform/LICENSE
Module parse failed: Unexpected token (1:4)
You may need an appropriate loader to handle this file type.
| MIT License
|
| Copyright (c) 2017 Charlie Robbins & the Contributors.
# ./node_modules/logform sync ^\.\/.*$
# ./node_modules/logform/index.js
# ./node_modules/winston/lib/winston.js
# ./src/logger.ts
# ./src/services/pipeline/handlers.ts
Runtime errors after I add the ContextReplacementPlugin
Serverless: GET /api (λ: GraphQLPlayground)
Serverless: The first request might take a few extra seconds
Serverless: Error while loading GraphQLPlayground
[ 'Error: Cannot find module "./combine".',
'at webpackContextResolve (webpack:///./node_modules/logform_sync_(.*)\\.js?:39:11)',
'at webpackContext (webpack:///./node_modules/logform_sync_(.*)\\.js?:32:11)',
'at Function.get (webpack:///./node_modules/logform/index.js?:27:101)',
'at eval (webpack:///./src/logger.ts?:34:20)',
I figured the best way to solve this was to address the issue directly in the logform library, so I submitted this PR: https://github.com/winstonjs/logform/pull/24

Cannot build app in firebase

Hello I have started work with firebase recently and stuck on one problem.
I am building small web app and I have connect this web app to firebase backend to read and write to databases.
Everything was ok and I had connection. I could put items to databases and get them by GET request. I have implemented simple authentication and that worked great too.
Suddenly today my app stops to build after 'ng serve' command in terminal window. I get an error:
ERROR in ./~/firebase/app/shared_promise.js
Module not found: Error: Can't resolve 'promise-polyfill' in '/Users/me/Desktop/GMO/node_modules/firebase/app'
# ./~/firebase/app/shared_promise.js 22:35-62
# ./~/firebase/app/firebase_app.js
# ./~/firebase/app.js
# ./~/firebase/firebase-browser.js
# ./src/app/auth/auth.service.ts
# ./src/app/app.module.ts
# ./src/main.ts
# multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts
I am sure that I didn't change anything inside firebase module.
Inside this ./~/firebase/app/shared_promise.js
there is a line there:
var PromiseImpl = scope.Promise || require('promise-polyfill');
and I have found that if I delete "|| require('promise-polyfill')" from it, the app works. Of course I don't want to do this, because this is element of module and I don't want to change it but I don't have any other idea...
Please advice!
#Andrew, your solution is working:
npm install promise-polyfill --save-exact

What should I do with these Javascript-console errors (Wordpress)?

reset.css Failed to load resource: the server responded with a status of 404 (Not Found)
jquery-migrate.js:23 JQMIGRATE: Migrate is installed with logging active, version 1.4.1
jquery-migrate.js:45 JQMIGRATE: jQuery.fn.load() is deprecated
migrateWarn # jquery-migrate.js:45
jquery-migrate.js:47 console.trace
migrateWarn # jquery-migrate.js:47
reset.css Failed to load resource: the server responded with a status of 404 (Not Found)
More info:
Some of my plugins' Javascript is not working but only on the home page. I've tried disabling all non-related plugins but this doesn't solve the problem.
jquery-migrate.js appears to be located in wp-includes/js/jquery/. I'm assuming this is the correct file location.
In the very beginning I including a file called reset.css but long ago deleted the file plus any reference to it (for example, in functions.php) so I'm not sure what the issue is there. It is correct that the file is not available but it also shouldn't be looking for it.
Can any tell me step by step what I need to do/change? If any other info necessary please ask! Many thanks.
EDIT: after deactivating debugging in wp-config the console changed to this:
GET http://match.onesquad.nl/wp-content/themes/match-theme/reset.css
jquery-migrate.js?ver=1.4.1:23 JQMIGRATE: Migrate is installed with logging active, version 1.4.1
jquery-migrate.js?ver=1.4.1:45 JQMIGRATE: jQuery.fn.load() is deprecated
migrateWarn # jquery-migrate.js?ver=1.4.1:45
jQuery.fn.(anonymous function) # jquery-migrate.js?ver=1.4.1:560
(anonymous) # (index):368
i # jquery.js?ver=1.12.4:2
fireWith # jquery.js?ver=1.12.4:2
ready # jquery.js?ver=1.12.4:2
K # jquery.js?ver=1.12.4:2
jquery-migrate.js?ver=1.4.1:47 console.trace
migrateWarn # jquery-migrate.js?ver=1.4.1:47
jQuery.fn.(anonymous function) # jquery-migrate.js?ver=1.4.1:560
(anonymous) # (index):368
i # jquery.js?ver=1.12.4:2
fireWith # jquery.js?ver=1.12.4:2
ready # jquery.js?ver=1.12.4:2
K # jquery.js?ver=1.12.4:2

Running into "Can't Resolve" Error After Migrating from Beta 31 to RC 1 in Angular-CLI App

In migrating from beta 31 to rc.1 in my Angular-CLI app, I am now getting some compilation errors, as it pertains to some of my custom icons/images. This is the error I'm getting:
ERROR in ./src/app/ui/nav-menu.component.css Module not found: Error:
Can't resolve './app/img/home-icon.svg' in
'/Users/mk/Documents/abc/src/app/ui' #
./src/app/ui/nav-menu.component.css 6:3777-3813 #
./src/app/ui/nav-menu.component.ts # ./src/app/app.module.ts #
./src/main.ts # multi webpack-dev-server/client?http://localhost:4200
./src/main.ts
Specifically, what does it indicate when the error states "can't resolve"? Does that imply the item isn't where the app is looking for it? Or something else?
If you are using angular-cli put static files such as images, fonts etc.. in assets folder and refer them in you HTML files as follows
<img src="assets/sample.jpg" alt="some alt">

Categories