Firebase Auth UI with Vuejs - firebase

I've followed this tutorial to create a vue component for login users with firebase Auth UI. but I keep getting an error in console. I've used firebase pre-built UI using its cdn in non-vue project before and it worked. but I can't figure out the way of implementing it with vueJS. any help?
source code userLogin.vue component :
<template>
<div id="userLogin">
<h1 class="text-center">Login</h1>
<div id="firebaseui-auth-container" style="margin-top:200px;"></div>
</div>
</template>
<script>
import firebaseui from 'firebaseui';
import firebase from '../firebaseInit'
export default {
name: 'userLogin',
data() {
return {
}
},
mounted() {
var uiConfig = {
signInSuccessUrl: '/success',
signInOptions: [
firebase.auth.GoogleAuthProvider.PROVIDER_ID,
firebase.auth.EmailAuthProvider.PROVIDER_ID
]
};
var ui = new firebaseui.auth.AuthUI(firebase.auth());
ui.start('#firebaseui-auth-container', uiConfig);
}
}
</script>
here is the error :
`[Vue warn]: Error in mounted hook: "TypeError: Cannot read property 'PROVIDER_ID' of undefined"
found in
---> <UserLogin> at src\components\userLogin.vue
<App> at src\App.vue
<Root>
warn # vue.esm.js?efeb:576
logError # vue.esm.js?efeb:1729
globalHandleError # vue.esm.js?efeb:1724
handleError # vue.esm.js?efeb:1713
callHook # vue.esm.js?efeb:2912
insert # vue.esm.js?efeb:4086
invokeInsertHook # vue.esm.js?efeb:5853
patch # vue.esm.js?efeb:6072
Vue._update # vue.esm.js?efeb:2652
updateComponent # vue.esm.js?efeb:2780
get # vue.esm.js?efeb:3130
Watcher # vue.esm.js?efeb:3119
mountComponent # vue.esm.js?efeb:2787
Vue$3.$mount # vue.esm.js?efeb:8407
Vue$3.$mount # vue.esm.js?efeb:10747
Vue._init # vue.esm.js?efeb:4559
Vue$3 # vue.esm.js?efeb:4648
(anonymous) # main.js?3479:17
./src/main.js # app.js:6169
__webpack_require__ # app.js:679
fn # app.js:89
0 # app.js:6194
__webpack_require__ # app.js:679
(anonymous) # app.js:725
(anonymous) # app.js:728
vue.esm.js?efeb:1733 TypeError: Cannot read property 'PROVIDER_ID' of undefined
at VueComponent.mounted (userLogin.vue?e569:23)
at callHook (vue.esm.js?efeb:2910)
at Object.insert (vue.esm.js?efeb:4086)
at invokeInsertHook (vue.esm.js?efeb:5853)
at Vue$3.patch [as __patch__] (vue.esm.js?efeb:6072)
at Vue$3.Vue._update (vue.esm.js?efeb:2652)
at Vue$3.updateComponent (vue.esm.js?efeb:2780)
at Watcher.get (vue.esm.js?efeb:3130)
at new Watcher (vue.esm.js?efeb:3119)
at mountComponent (vue.esm.js?efeb:2787)
node version : v8.9.4

Related

Trying to setup firebase for my Vue 3 walkie-talkie project

It seems some features of the Vuefire SDK have been deprecated, so it keeps throwing errors. This is my Repo & these are some of the error messages.
Browser console error
WARNING Compiled with 3 warnings 2:29:56 PM
warning in ./src/App.vue?vue&type=script&lang=js
export 'auth' (imported as 'auth') was not found in './firebase' (possible exports: default, storage)
warning in ./src/firebase.js
export 'default' (imported as 'firebase') was not found in 'firebase/app' (possible exports: FirebaseError, SDK_VERSION, _DEFAULT_ENTRY_NAME, _addComponent, _addOrOverwriteComponent, _apps, _clearComponents, _components, _getProvider, _registerComponent, _removeServiceInstance, deleteApp, getApp, getApps, initializeApp, onLog, registerVersion, setLogLevel)
warning in ./src/main.js
export 'default' (imported as 'Vue') was not found in 'vue' (possible exports: BaseTransition, Comment, EffectScope, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, compile, computed, createApp, createBlock, createCommentVNode, createElementBlock, createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineProps, defineSSRCustomElement, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId)
App running at:
Local: http://localhost:8080/
Network: http://192.168.0.154:8080/
Cli error
app.js:160 Uncaught TypeError: Cannot read properties of undefined (reading 'storage')
at eval (firebase.js?67d8:28:1)
at ./src/firebase.js (app.js:41:1)
at __webpack_require__ (app.js:157:33)
at fn (app.js:390:21)
at eval (index.js??clonedRule…script&lang=js:2:67)
at ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/App.vue?vue&type=script&lang=js (app.js:19:1)
at __webpack_require__ (app.js:157:33)
at fn (app.js:390:21)
at eval (App.vue?vue&type=script&lang=js:5:206)
at ./src/App.vue?vue&type=script&lang=js (app.js:85:1)
eval # firebase.js?67d8:28
./src/firebase.js # app.js:41
__webpack_require__ # app.js:157
fn # app.js:390
eval # index.js??clonedRule…pe=script&lang=js:2
./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/App.vue?vue&type=script&lang=js # app.js:19
__webpack_require__ # app.js:157
fn # app.js:390
eval # App.vue?vue&type=script&lang=js:5
./src/App.vue?vue&type=script&lang=js # app.js:85
__webpack_require__ # app.js:157
fn # app.js:390
eval # App.vue:3
./src/App.vue # app.js:74
__webpack_require__ # app.js:157
fn # app.js:390
eval # main.js:3
./src/main.js # app.js:52
__webpack_require__ # app.js:157
(anonymous) # app.js:1278
__webpack_require__.O # app.js:203
(anonymous) # app.js:1279
(anonymous)
I've searched online & it seems to be a version problem (my guess). However when I try to install firebase versions 8 and below it throws up some brand new errors. I've set up my firebase config with all my details on the firebase.js file in my repo.
I'm just trying to connect my firebase with my application and test to ensure it works. I'd really appreciate any help.

Asset Build with Webpack encore - Error: Problem deleting JS entry for _tmp_copy when using configureFilenames #978

Version:
symfony v5.2.7
symfony/webpack-encore-bundle v1.11.2
I want to set the name of my assets with my real version name.
My prefered way would be to use enableVersioning and generate the hash myself, but i didn't find how.
The hack i found is by replacing .enableVersioning(Encore.isProduction()) with :
.configureFilenames({
js: '[name].js?version=' + version,
css: '[name].css?version=' + version
})
Here is my webpack.config.js file
var Encore = require('#symfony/webpack-encore');
// var version = require('./package.json').version;
// Manually configure the runtime environment if not already configured yet by the "encore" command.
// It's useful when you use tools that rely on webpack.config.js file.
if (!Encore.isRuntimeEnvironmentConfigured()) {
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
}
Encore
// directory where compiled assets will be stored
.setOutputPath('public/build/')
// public path used by the web server to access the output path
.setPublicPath('/build')
// only needed for CDN's or sub-directory deploy
.setManifestKeyPrefix('build/')
/*
* ENTRY CONFIG
*
* Add 1 entry for each "page" of your app
* (including one that's included on every page - e.g. "app")
*
* Each entry will result in one JavaScript file (e.g. app.js)
* and one CSS file (e.g. app.css) if your JavaScript imports CSS.
*/
.addEntry('app', './assets/app.js')
.addEntry('login', './assets/js/scenes/login.js')
.addEntry('home', './assets/js/scenes/home.js')
.addEntry('container', './assets/js/scenes/container.js')
.addEntry('aside', './assets/js/component/containerGroupSelector.js')
.addEntry('chart', './assets/js/component/containerMeasuresChart.js')
.addEntry('alerts', './assets/js/scenes/alertsList.js')
.addEntry('createAlert', './assets/js/scenes/createAlert.js')
.addEntry('profile', './assets/js/scenes/profile.js')
.addEntry('sensor', './assets/js/scenes/sensorList.js')
.addEntry('sensorShow', './assets/js/scenes/sensorShow.js')
//.addEntry('page2', './assets/page2.js')
// When enabled, Webpack "splits" your files into smaller pieces for greater optimization.
//.splitEntryChunks()
// will require an extra script tag for runtime.js
// but, you probably want this, unless you're building a single-page app
.enableSingleRuntimeChunk()
//.disableSingleRuntimeChunk()
/*
* FEATURE CONFIG
*
* Enable & configure other features below. For a full
* list of features, see:
* https://symfony.com/doc/current/frontend.html#adding-more-features
*/
.cleanupOutputBeforeBuild()
.enableBuildNotifications()
.enableSourceMaps(!Encore.isProduction())
// enables hashed filenames (e.g. app.abc123.css)
.enableVersioning(Encore.isProduction())
// .configureFilenames({
// js: '[name].js?version=' + version,
// css: '[name].css?version=' + version
// })
// enables #babel/preset-env polyfills
.configureBabelPresetEnv((config) => {
config.useBuiltIns = 'usage';
config.corejs = 3;
})
// refresh browser
.configureWatchOptions(function(watchOptions) {
// enable polling and check for changes every 250ms
// polling is useful when running Encore inside a Virtual Machine
watchOptions.poll = 250;
})
// enables Sass/SCSS support
.enableSassLoader()
.copyFiles({
from: './assets/images',
to: 'images/[path][name].[ext]',
pattern: /\.(png|jpg|jpeg|svg)$/
})
.copyFiles({
from: './assets/icon',
to: 'icon/[path][name].[ext]',
pattern: /\.(png|jpg|jpeg|svg)$/
})
// uncomment if you use TypeScript
//.enableTypeScriptLoader()
// uncomment to get integrity="..." attributes on your script & link tags
// requires WebpackEncoreBundle 1.4 or higher
//.enableIntegrityHashes(Encore.isProduction())
// uncomment if you're having problems with a jQuery plugin
//.autoProvidejQuery()
// uncomment if you use API Platform Admin (composer req api-admin)
//.enableReactPreset()
//.addEntry('admin', './assets/admin.js')
;
module.exports = Encore.getWebpackConfig();
If I uncomment var version = require('./package.json').version; and replace enableVersioning by configureFilenames (see above) I get the following error when building assets :
panel | (node:74) UnhandledPromiseRejectionWarning: Error: Problem deleting JS entry for _tmp_copy: 0 files were deleted
panel | at /var/www/panel/node_modules/#symfony/webpack-encore/lib/webpack/delete-unused-entries-js-plugin.js:41:27
panel | at Array.forEach (<anonymous>)
panel | at emit (/var/www/panel/node_modules/#symfony/webpack-encore/lib/webpack/delete-unused-entries-js-plugin.js:19:28)
panel | at AsyncSeriesHook.eval [as callAsync] (eval at create (/var/www/panel/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:65:1)
panel | at AsyncSeriesHook.lazyCompileHook (/var/www/panel/node_modules/tapable/lib/Hook.js:154:20)
panel | at Compiler.emitAssets (/var/www/panel/node_modules/webpack/lib/Compiler.js:491:19)
panel | at onCompiled (/var/www/panel/node_modules/webpack/lib/Compiler.js:278:9)
panel | at /var/www/panel/node_modules/webpack/lib/Compiler.js:681:15
panel | at AsyncSeriesHook.eval [as callAsync] (eval at create (/var/www/panel/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:4:1)
panel | at AsyncSeriesHook.lazyCompileHook (/var/www/panel/node_modules/tapable/lib/Hook.js:154:20)
panel | at /var/www/panel/node_modules/webpack/lib/Compiler.js:678:31
panel | at AsyncSeriesHook.eval [as callAsync] (eval at create (/var/www/panel/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:7:1)
panel | at AsyncSeriesHook.lazyCompileHook (/var/www/panel/node_modules/tapable/lib/Hook.js:154:20)
panel | at /var/www/panel/node_modules/webpack/lib/Compilation.js:1423:35
panel | at AsyncSeriesHook.eval [as callAsync] (eval at create (/var/www/panel/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:7:1)
panel | at AsyncSeriesHook.lazyCompileHook (/var/www/panel/node_modules/tapable/lib/Hook.js:154:20)
panel | at /var/www/panel/node_modules/webpack/lib/Compilation.js:1414:32
panel | at eval (eval at create (/var/www/panel/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:17:1)
panel | (node:74) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
panel | (node:74) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
UPDATE:
After Upgrading the node package#symfony/webpack-encore to 1.3.0, here is the new error message:
[webpack-cli] HookWebpackError: Problem deleting JS entry for _tmp_copy: 0 files were deleted ()
at makeWebpackError (/var/www/panel/node_modules/webpack/lib/HookWebpackError.js:49:9)
at /var/www/panel/node_modules/webpack/lib/Compilation.js:2496:12
at eval (eval at create (/var/www/panel/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:79:1)
at fn (/var/www/panel/node_modules/webpack/lib/Compilation.js:427:17)
at Hook.eval [as callAsync] (eval at create (/var/www/panel/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:76:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/var/www/panel/node_modules/tapable/lib/Hook.js:18:14)
at cont (/var/www/panel/node_modules/webpack/lib/Compilation.js:2493:34)
at /var/www/panel/node_modules/webpack/lib/Compilation.js:2539:10
at /var/www/panel/node_modules/neo-async/async.js:2830:7
at Object.each (/var/www/panel/node_modules/neo-async/async.js:2850:39)
-- inner error --
Error: Problem deleting JS entry for _tmp_copy: 0 files were deleted ()
at /var/www/panel/node_modules/#symfony/webpack-encore/lib/webpack/delete-unused-entries-js-plugin.js:49:27
at Set.forEach (<anonymous>)
at deleteEntries (/var/www/panel/node_modules/#symfony/webpack-encore/lib/webpack/delete-unused-entries-js-plugin.js:18:28)
at /var/www/panel/node_modules/#symfony/webpack-encore/lib/webpack/delete-unused-entries-js-plugin.js:59:17
at /var/www/panel/node_modules/webpack/lib/Compilation.js:531:56
at fn (/var/www/panel/node_modules/webpack/lib/Compilation.js:425:10)
at Hook.eval [as callAsync] (eval at create (/var/www/panel/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:76:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/var/www/panel/node_modules/tapable/lib/Hook.js:18:14)
at cont (/var/www/panel/node_modules/webpack/lib/Compilation.js:2493:34)
at /var/www/panel/node_modules/webpack/lib/Compilation.js:2539:10
caused by plugins in Compilation.hooks.processAssets
Error: Problem deleting JS entry for _tmp_copy: 0 files were deleted ()
at /var/www/panel/node_modules/#symfony/webpack-encore/lib/webpack/delete-unused-entries-js-plugin.js:49:27
at Set.forEach (<anonymous>)
at deleteEntries (/var/www/panel/node_modules/#symfony/webpack-encore/lib/webpack/delete-unused-entries-js-plugin.js:18:28)
at /var/www/panel/node_modules/#symfony/webpack-encore/lib/webpack/delete-unused-entries-js-plugin.js:59:17
at /var/www/panel/node_modules/webpack/lib/Compilation.js:531:56
at fn (/var/www/panel/node_modules/webpack/lib/Compilation.js:425:10)
at Hook.eval [as callAsync] (eval at create (/var/www/panel/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:76:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/var/www/panel/node_modules/tapable/lib/Hook.js:18:14)
at cont (/var/www/panel/node_modules/webpack/lib/Compilation.js:2493:34)
at /var/www/panel/node_modules/webpack/lib/Compilation.js:2539:10
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

AWS Amplify `No plugin found in Storage for the provider` error

My AWS amplify application uses storage. When I am running the application I am getting a No plugin found in Storage for the provider error. Some of things that I have tried are:
a. removing and adding storage module by `amplify add\remove storage` commands.
b. Manually configuring storage in main.js based on this [github issue][1].
c. deleting the application's node_modules and adding them again.
What could I be missing?
main.js:
import Amplify,{Auth, Storage} from 'aws-amplify';
import '#aws-amplify/ui-vue';
import aws_exports from './aws-exports';
Amplify.configure(aws_exports);
main.js: Added code to manually configure storage as per this github issue:
Amplify.configure({
Auth: {
identityPoolId: '<IdentityPoolId>',
region: "<region>",
userPoolId: "<userPoolId>",
userPoolWebClientId: "<userPoolWebClientId>",
},
Storage: {
AWSS3: {
bucket: "<bucket>",
region: "<region>",
}
}
});
StackTrace:
Uncaught (in promise) No plugin found in Storage for the provider
(anonymous) # 4.js:241
step # 4.js:69
(anonymous) # 4.js:50
(anonymous) # 4.js:44
push../node_modules/#aws-amplify/storage/lib-esm/Storage.js.__awaiter # 4.js:40
push../node_modules/#aws-amplify/storage/lib-esm/Storage.js.Storage.put # 4.js:234
_loop$ # 18.js:286
tryCatch # vendors~app.js:455791
invoke # vendors~app.js:456017
prototype.<computed> # vendors~app.js:455843
tryCatch # vendors~app.js:455791
maybeInvokeDelegate # vendors~app.js:456080
invoke # vendors~app.js:455991
prototype.<computed> # vendors~app.js:455843
asyncGeneratorStep # vendors~app.js:162870
_next # vendors~app.js:162892
(anonymous) # vendors~app.js:162899
F # vendors~app.js:319219
(anonymous) # vendors~app.js:162888
TranscribeFiles # 18.js:392
invokeWithErrorHandling # vendors~app.js:433345
invoker # vendors~app.js:433670
invokeWithErrorHandling # vendors~app.js:433345
Vue.$emit # vendors~app.js:435374
clickButton # vendors~app.js:444622
click # vendors~app.js:444498
invokeWithErrorHandling # vendors~app.js:433345
invoker # vendors~app.js:433670
original._wrapper # vendors~app.js:438399
I was able to get the application working by
a. removing the manual configuration in main.js,
b. removing storage completely,
c. publishing the application to aws,
d. adding storage back again and publishing the application to aws.

Module not found: Error: Can't resolve './firebase' in 'C:

I'm getting this error in my vuejs webApp, hope some one tell me how to solve it:
./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?
type=script&index=0!./src/components/Envio.vue
Module not found: Error: Can't resolve './firebase' in
'C:\Users\#####\Desktop\#####\src\components'
# ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?
type=script&index=0!./src/components/Envio.vue 17:0-32
# ./src/components/Envio.vue
# ./src/routes.js
# ./src/main.js
# multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-
server ./src/main.js
this is the script in my vue file:
<script>
import { db } from './firebase'
export default {
data: {
mensaje: null,
... }
}
</script>
I assume you have installed firebase via a node package manager using npm command. If so, the following import statement should fix the problem.
import { db } from 'firebase'

Uncaught Error: Module build failed: Error: No PostCSS Config found in: \ng2-admin\node_modules\bootstrap-loader at Error (native)

I have clone ng2-admin directory from git hub few days back and run npm install after that i am able to run and see the UI, now I had been deleted node_modules folder, docs folder, and dist folder from ng2-admin now facing below error in browser console with scattered UI.
So how to fix below error,
`
Uncaught Error: Module build failed: Error: No PostCSS Config found in: D:\ng2-admin\node_modules\bootstrap-loader
at Error (native)
at D:\ng2-admin\node_modules\postcss-load-config\index.js:51:26
at Error (native)
at D:\ng2-admin\node_modules\postcss-load-config\index.js:51:26
at Object../node_modules/css-loader/index.js!./node_modules/postcss-loader/index.js!./node_modules/resolve-url-loader/index.js!./node_modules/sass-loader/index.js?sourceMap!./node_modules/bootstrap-loader/lib/bootstrap.styles.loader.js!./node_modules/bootstrap-loader/no-op.js (http://localhost:5000/assets/vendor.bundle.js:56497:7)
at __webpack_require__ (http://localhost:5000/assets/polyfills.bundle.js:54:30)
at Object../node_modules/style-loader/index.js!./node_modules/css-loader/index.js!./node_modules/postcss-loader/index.js!./node_modules/resolve-url-loader/index.js!./node_modules/sass-loader/index.js?sourceMap!./node_modules/bootstrap-loader/lib/bootstrap.styles.loader.js!./node_modules/bootstrap-loader/no-op.js (http://localhost:5000/assets/vendor.bundle.js:88168:15)
at __webpack_require__ (http://localhost:5000/assets/polyfills.bundle.js:54:30)
at Object../node_modules/bootstrap-loader/lib/bootstrap.loader.js!./node_modules/bootstrap-loader/no-op.js (http://localhost:5000/assets/vendor.bundle.js:52755:22)
at __webpack_require__ (http://localhost:5000/assets/polyfills.bundle.js:54:30)
at Object../node_modules/bootstrap-loader/loader.js (http://localhost:5000/assets/vendor.bundle.js:52782:18)
at __webpack_require__ (http://localhost:5000/assets/polyfills.bundle.js:54:30)
at Object../src/vendor.browser.ts (http://localhost:5000/assets/vendor.bundle.js:90058:1)
at __webpack_require__ (http://localhost:5000/assets/polyfills.bundle.js:54:30)
at Object.5 (http://localhost:5000/assets/vendor.bundle.js:90087:18)
at __webpack_require__ (http://localhost:5000/assets/polyfills.bundle.js:54:30)
at webpackJsonpCallback (http://localhost:5000/assets/polyfills.bundle.js:25:23)
at http://localhost:5000/assets/vendor.bundle.js:2:1
./node_modules/css-loader/index.js!./node_modules/postcss-loader/index.js!./node_modules/resolve-url-loader/index.js!./node_modules/sass-loader/index.js?sourceMap!./node_modules/bootstrap-loader/lib/bootstrap.styles.loader.js!./node_modules/bootstrap-loader/no-op.js # util.js:164
__webpack_require__ # bootstrap 7cfd64b…:52
./node_modules/style-loader/index.js!./node_modules/css-loader/index.js!./node_modules/postcss-loader/index.js!./node_modules/resolve-url-loader/index.js!./node_modules/sass-loader/index.js?sourceMap!./node_modules/bootstrap-loader/lib/bootstrap.styles.loader.js!./node_modules/bootstrap-loader/no-op.js # no-op.js?6a4c:4
__webpack_require__ # bootstrap 7cfd64b…:52
./node_modules/bootstrap-loader/lib/bootstrap.loader.js!./node_modules/bootstrap-loader/no-op.js # no-op.js:1
__webpack_require__ # bootstrap 7cfd64b…:52
./node_modules/bootstrap-loader/loader.js # loader.js:1
__webpack_require__ # bootstrap 7cfd64b…:52
./src/vendor.browser.ts # vendor.browser.ts:24
__webpack_require__ # bootstrap 7cfd64b…:52
5 # src async:7
__webpack_require__ # bootstrap 7cfd64b…:52
webpackJsonpCallback # bootstrap 7cfd64b…:23
(anonymous) # vendor.bundle.js:2
lang.js:134 Angular 2 is running in the development mode. Call enableProdMode() to enable the production mode.
client:38 [WDS] Errors while compiling.
client:80 ./~/css-loader!./~/postcss-loader!./~/resolve-url-loader!./~/sass-loader?sourceMap!./~/bootstrap-loader/lib/bootstrap.styles.loader.js!./~/bootstrap-loader/no-op.js
Module build failed: Error: No PostCSS Config found in: D:\ng2-admin\node_modules\bootstrap-loader
at Error (native)
at D:\Client2\ng2-admin\node_modules\postcss-load-config\index.js:51:26
# ./~/style-loader!./~/css-loader!./~/postcss-loader!./~/resolve-url-loader!./~/sass-loader?sourceMap!./~/bootstrap-loader/lib/bootstrap.styles.loader.js!./~/bootstrap-loader/no-op.js 4:14-193
# ./~/bootstrap-loader/lib/bootstrap.loader.js!./~/bootstrap-loader` /no-op.js`
# ./~/bootstrap-loader/loader.js
# ./src/vendor.browser.ts
# multi vendor
`
The solution is very simple. You need to add a file on your project root directory:
postcss.config.js
Inside, the content can be:
module.exports = {};
This is a translated version of a now-deleted non-English answer by Feng SHADU.
If you don't want to add another file, it's enough to add your options in your webpack config:
{
loader: `postcss-loader`,
options: {
options: {},
plugins: () => {
autoprefixer({ browsers: [ 'last 2 versions' ] });
}
}
},
The solution is actually to properly reference the config file in the loader options like this (create an empty one if you don't have it yet, though):
{
loader: 'postcss-loader',
options: {
config: {
path: 'path/to/postcss.config.js'
}
}
}
You are not supposed to create empty or dummy placeholder configs in the node_modules folders.
This can be caused by a reference error, more specifically an import for CSS file that doesn't exist.
Create node_modules/bootstrap-loader/postcss.config.js with the contents module.exports={};

Resources