Error: Module not found: Error: Can't resolve src/app/app.component.css?ngResource Angular - node.js

I'm facing this 3 problems that I still can't understand where your mistakes are.
Error: Module not found: Error: Can't resolve 'C:/Users/DexSh/desktop/C# Angular/Testing/src/app/app.component.css?ngResource' in 'C:\Users\DexSh\desktop\C# Angular\Testing'
Error: Module not found: Error: Can't resolve 'C:\Users\DexSh\desktop\C# Angular\Testing\node_modules\webpack-dev-server\client\index.js?protocol=auto%3A&username=&password=&hostname=0.0.0.0&port=0&pathname=%2Fng-cli-ws&logging=info&overlay=%7B%22errors%22%3Atrue%2C%22warnings%22%3Afalse%7D&reconnect=10&hot=false&live-reload=true' in 'C:\Users\DexSh\desktop\C# Angular\Testing'
Error: The loader "C:/Users/DexSh/desktop/C# Angular/Testing/src/app/app.component.css" didn't return a string.
when using ng build returns this
Warning: ▲ [WARNING] Comments in CSS use "/* ... */" instead of "//" [js-comment-in-css]
C:/Users/DexSh/desktop/C# Angular/Testing/src/app/app.component.css:1:18:
1 │ /******/ (() => { // webpackBootstrap
╵ ~~
Warning: ▲ [WARNING] Unexpected "(" [css-syntax-error]
C:/Users/DexSh/desktop/C# Angular/Testing/src/app/app.component.css:1:9:
1 │ /******/ (() => { // webpackBootstrap
╵ ^
Error: Module not found: Error: Can't resolve 'C:/Users/DexSh/desktop/C# Angular/Testing/src/app/app.component.css?ngResource' in 'C:\Users\DexSh\desktop\C# Angular\Testing'
Error: The loader "C:/Users/DexSh/desktop/C# Angular/Testing/src/app/app.component.css" didn't return a string.
Can anyone tell me what's causing this, it's in every project
Waiting for a normal build and project execution

The problem is that you have a # in your folder name -> (C# Angular).
This f. problem made me to go on rampage too...

Related

npm install node-geocoder issue while running npm run build in type script + PCF (Powerapps Component Framework)

I have created a PCF (Powerapps Component Framework) in which I am using the GEOCODE feature. I have installed the required components using "npm install node-geocoder" and have added the below code :
let nodeGeocoder = require('node-geocoder');
let options = {
provider: 'openstreetmap'
};
let geoCoder = nodeGeocoder(options);
geoCoder.geocode('Luray Caverns')
.then((res)=> {
console.log(res[0].latitude);
console.log(res[0].longitude);
})
.catch((err)=> {
console.log(err);
});
When i build this code using "npm run build", the build fails with following error:
ERROR in ./node_modules/request/lib/har.js
Module not found: Error: Can't resolve 'fs' in 'D:\PCF\Demo\node_modules\request\lib'
Module not found: Error: Can't resolve 'net' in 'D:\PCF\Demo\node_modules\forever-agent'
ERROR in ./node_modules/node-geocoder/lib/geocoder/agolgeocoder.js
Module not found: Error: Can't resolve 'net' in 'D:\PCF\Demo\node_modules\node-geocoder\lib\geocoder'
ERROR in ./node_modules/node-geocoder/lib/geocoder/datasciencetoolkitgeocoder.js
Module not found: Error: Can't resolve 'net' in 'D:\PCF\Demo\node_modules\node-geocoder\lib\geocoder'
ERROR in ./node_modules/node-geocoder/lib/geocoder/abstractgeocoder.js
Module not found: Error: Can't resolve 'net' in 'D:\PCF\Demo\node_modules\node-geocoder\lib\geocoder'
Any help would be helpful.
Thanks in advance.

Facing error while using image_picker in flutter

Hy, I am new to flutter and while working with an app that uses image_picker to get images from the gallery I was facing this error.
C:\Users\Hrishabh Mishra\Desktop\FDR\Flutter\course\08\mycameraapp>flutter run
Launching lib\main.dart on Redmi Note 5 Pro in debug mode...
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerDelegate.java:15: error: package android.support.annotation does not exist
import android.support.annotation.VisibleForTesting;
^
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerDelegate.java:16: error: cannot find symbol
import android.support.v4.app.ActivityCompat;
^
symbol: class ActivityCompat
location: package android.support.v4.app
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerDelegate.java:17: error: package android.support.v4.content does not exist
import android.support.v4.content.FileProvider;
^
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerFileProvider.java:3: error: package android.support.v4.content does not exist
import android.support.v4.content.FileProvider;
^
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerFileProvider.java:10: error: cannot find symbol
public class ImagePickerFileProvider extends FileProvider {}
^
symbol: class FileProvider
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerPlugin.java:8: error: package android.support.annotation does not exist
import android.support.annotation.VisibleForTesting;
^
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerDelegate.java:68: error: cannot find symbol
#VisibleForTesting static final int REQUEST_CODE_CHOOSE_IMAGE_FROM_GALLERY = 2342;
^
symbol: class VisibleForTesting
location: class ImagePickerDelegate
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerDelegate.java:69: error: cannot find symbol
#VisibleForTesting static final int REQUEST_CODE_TAKE_IMAGE_WITH_CAMERA = 2343;
^
symbol: class VisibleForTesting
location: class ImagePickerDelegate
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerDelegate.java:70: error: cannot find symbol
#VisibleForTesting static final int REQUEST_EXTERNAL_IMAGE_STORAGE_PERMISSION = 2344;
^
symbol: class VisibleForTesting
location: class ImagePickerDelegate
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerDelegate.java:71: error: cannot find symbol
#VisibleForTesting static final int REQUEST_CAMERA_IMAGE_PERMISSION = 2345;
^
symbol: class VisibleForTesting
location: class ImagePickerDelegate
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerDelegate.java:72: error: cannot find symbol
#VisibleForTesting static final int REQUEST_CODE_CHOOSE_VIDEO_FROM_GALLERY = 2352;
^
symbol: class VisibleForTesting
location: class ImagePickerDelegate
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerDelegate.java:73: error: cannot find symbol
#VisibleForTesting static final int REQUEST_CODE_TAKE_VIDEO_WITH_CAMERA = 2353;
^
symbol: class VisibleForTesting
location: class ImagePickerDelegate
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerDelegate.java:74: error: cannot find symbol
#VisibleForTesting static final int REQUEST_EXTERNAL_VIDEO_STORAGE_PERMISSION = 2354;
^
symbol: class VisibleForTesting
location: class ImagePickerDelegate
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerDelegate.java:75: error: cannot find symbol
#VisibleForTesting static final int REQUEST_CAMERA_VIDEO_PERMISSION = 2355;
^
symbol: class VisibleForTesting
location: class ImagePickerDelegate
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerDelegate.java:77: error: cannot find symbol
#VisibleForTesting final String fileProviderName;
^
symbol: class VisibleForTesting
location: class ImagePickerDelegate
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerDelegate.java:164: error: cannot find symbol
#VisibleForTesting
^
symbol: class VisibleForTesting
location: class ImagePickerDelegate
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerPlugin.java:40: error: cannot find symbol
#VisibleForTesting
^
symbol: class VisibleForTesting
location: class ImagePickerPlugin
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerDelegate.java:122: error: cannot find symbol
return ActivityCompat.checkSelfPermission(activity, permissionName)
^
symbol: variable ActivityCompat
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerDelegate.java:128: error: cannot find symbol
ActivityCompat.requestPermissions(activity, new String[] {permissionName}, requestCode);
^
symbol: variable ActivityCompat
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerDelegate.java:140: error: cannot find symbol
return FileProvider.getUriForFile(activity, fileProviderName, file);
^
symbol: variable FileProvider
20 errors
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':image_picker:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 28s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 32.5s
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
Building plugin image_picker...
Running Gradle task 'assembleAarRelease'...
Running Gradle task 'assembleAarRelease'... Done 22.3s
WARNING: The option setting 'android.enableR8=true' is experimental and unsupported.
The current default is 'false'
Consider disabling R8 by removing 'android.enableR8=true' from your gradle.properties before publishing your app.
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'imagepicker'.
SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 16s
The plugin image_picker could not be built due to the issue above.
SDK location not found. Define location with sdk.dir in the local.properties file or
with an ANDROID_HOME environment variable.
Configure the Android SDK first.
Method 1:
Go to Settings
Expand Language & Frameworks
Select Flutter
Enter the flutter sdk path in Flutter SDK Path textbox
Click Ok
Method 2:
Flutter provides a command to update the Android SDK path:
Use flutter config --android-sdk <path-to-your-android-sdk-path>

Kerberos library is not installed

I have a simple project to test Kerberos authentication. This is a Windows machine.
In my package.json:
"dependencies": {
"kerberos": "^0.0.24",
"mongodb": "^3.0.10"
}
Connection URL:
const url = 'mongodb://userxxx%40XXXXX.XXXXX.COM:Password01#servername:27017/?authMechanism=GSSAPI&authSource=%24external&ssl=true';
But when I'm trying to connect in the code:
MongoClient.connect(url, (err, client) => {
if (err) {
console.error(err);
I get an error message Error: Kerberos library is not installed
I tried nuking node_modules and reinstalling everything. I tried installing kerberos module globally and locally. Same consistent result every time. Looking for insights. Thank you.
EDIT:
No errors during installation/compilation:
$ yarn add mongodb kerberos
yarn add v1.5.1
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 8 new dependencies.
info Direct dependencies
├─ kerberos#0.0.24
└─ mongodb#3.0.10
info All dependencies
├─ bson#1.0.9
├─ kerberos#0.0.24
├─ mongodb-core#3.0.9
├─ mongodb#3.0.10
├─ nan#2.10.0
├─ require_optional#1.0.1
├─ resolve-from#2.0.0
└─ semver#5.5.0
Done in 23.56s.
EDIT 2:
C:\Users\username\Projects\node.js\kerberos-test>npm init -y
Wrote to C:\Users\username\Projects\node.js\kerberos-test\package.json:
{
"name": "kerberos-test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
C:\Users\username\Projects\node.js\kerberos-test>npm install kerberos mongodb
--save
> kerberos#0.0.24 install C:\Users\username\Projects\node.js\kerberos-test\nod
e_modules\kerberos
> (node-gyp rebuild) || (exit 0)
C:\Users\username\Projects\node.js\kerberos-test\node_modules\kerberos>if not
defined npm_config_node_gyp (node "C:\Users\username\AppData\Roaming\npm\node_
modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp
\bin\node-gyp.js" rebuild ) else (node "C:\Users\username\AppData\Roaming\npm
\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
kerberos.cc
worker.cc
security_buffer.cc
security_buffer_descriptor.cc
security_context.cc
security_credentials.cc
win_delay_load_hook.cc
..\lib\win32\wrappers\security_credentials.cc(314): warning C4996: 'Nan::Callba
ck::Call': was declared deprecated [C:\Users\username\Projects\node.js\kerber
os-test\node_modules\kerberos\build\kerberos.vcxproj]
C:\Users\username\Projects\node.js\kerberos-test\node_modules\nan\nan.h(161
8): note: see declaration of 'Nan::Callback::Call'
..\lib\win32\wrappers\security_credentials.cc(341): warning C4996: 'Nan::Callba
ck::Call': was declared deprecated [C:\Users\username\Projects\node.js\kerber
os-test\node_modules\kerberos\build\kerberos.vcxproj]
C:\Users\username\Projects\node.js\kerberos-test\node_modules\nan\nan.h(161
8): note: see declaration of 'Nan::Callback::Call'
..\lib\win32\wrappers\security_context.cc(49): warning C4996: 'Nan::Callback::C
all': was declared deprecated [C:\Users\username\Projects\node.js\kerberos-te
st\node_modules\kerberos\build\kerberos.vcxproj]
C:\Users\username\Projects\node.js\kerberos-test\node_modules\nan\nan.h(161
8): note: see declaration of 'Nan::Callback::Call'
..\lib\win32\wrappers\security_context.cc(67): warning C4996: 'Nan::Callback::C
all': was declared deprecated [C:\Users\username\Projects\node.js\kerberos-te
st\node_modules\kerberos\build\kerberos.vcxproj]
C:\Users\username\Projects\node.js\kerberos-test\node_modules\nan\nan.h(161
8): note: see declaration of 'Nan::Callback::Call'
..\lib\win32\wrappers\security_context.cc(612): warning C4311: 'type cast': poi
nter truncation from 'unsigned long *' to 'unsigned long' [C:\Users\username\
Projects\node.js\kerberos-test\node_modules\kerberos\build\kerberos.vcxproj]
..\lib\win32\wrappers\security_context.cc(612): warning C4302: 'type cast': tru
ncation from 'unsigned long *' to 'unsigned long' [C:\Users\username\Projects
\node.js\kerberos-test\node_modules\kerberos\build\kerberos.vcxproj]
base64.c
kerberos_sspi.c
Creating library C:\Users\username\Projects\node.js\kerberos-test\node_m
odules\kerberos\build\Release\kerberos.lib and object C:\Users\username\Pro
jects\node.js\kerberos-test\node_modules\kerberos\build\Release\kerberos.exp
Generating code
Finished generating code
kerberos.vcxproj -> C:\Users\username\Projects\node.js\kerberos-test\node_m
odules\kerberos\build\Release\\kerberos.node
kerberos.vcxproj -> C:\Users\username\Projects\node.js\kerberos-test\node_m
odules\kerberos\build\Release\kerberos.pdb (Full PDB)
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN kerberos-test#1.0.0 No description
npm WARN kerberos-test#1.0.0 No repository field.
+ kerberos#0.0.24
+ mongodb#3.0.10
added 8 packages from 13 contributors and audited 8 packages in 22.648s
found 0 vulnerabilities
C:\Users\username\Projects\node.js\kerberos-test>
After copying the index.js file in from the other test project:
C:\Users\username\Projects\node.js\kerberos-test>node index.js
Error: Kerberos library is not installed
at SSPI.auth (C:\Users\username\Projects\node.js\kerberos-test\node_module
s\mongodb-core\lib\auth\sspi.js:58:41)
at authenticate (C:\Users\username\Projects\node.js\kerberos-test\node_mod
ules\mongodb-core\lib\connection\pool.js:244:17)
at authenticateLiveConnections (C:\Users\username\Projects\node.js\kerbero
s-test\node_modules\mongodb-core\lib\connection\pool.js:831:7)
at C:\Users\username\Projects\node.js\kerberos-test\node_modules\mongodb-c
ore\lib\connection\pool.js:876:5
at waitForLogout (C:\Users\username\Projects\node.js\kerberos-test\node_mo
dules\mongodb-core\lib\connection\pool.js:867:34)
at Pool.auth (C:\Users\username\Projects\node.js\kerberos-test\node_module
s\mongodb-core\lib\connection\pool.js:874:3)
at Server.auth (C:\Users\username\Projects\node.js\kerberos-test\node_modu
les\mongodb-core\lib\topologies\server.js:922:20)
at Server.auth (C:\Users\username\Projects\node.js\kerberos-test\node_modu
les\mongodb\lib\topologies\topology_base.js:379:30)
at authenticate (C:\Users\username\Projects\node.js\kerberos-test\node_mod
ules\mongodb\lib\authenticate.js:56:23)
at module.exports (C:\Users\username\Projects\node.js\kerberos-test\node_m
odules\mongodb\lib\authenticate.js:112:12)
C:\Users\username\Projects\node.js\kerberos-test>
After some digging around I found this in mongodb-core/lib/auth/sspi.js:
try {
Kerberos = require_optional('kerberos').Kerberos;
// Authentication process for Mongo
MongoAuthProcess = require_optional('kerberos').processes.MongoAuthProcess;
} catch (err) {} // eslint-disable-line
The problem is it silently catches the error and doesn't report anything. After placing console.log(err) in the catch, I saw the following error:
Error: optional dependency [kerberos] found but version [0.0.24] did not satisfy constraint [^0.0.23]
sspi.js:34
code:"OPTIONAL_MODULE_NOT_FOUND"
message:"optional dependency [kerberos] found but version [0.0.24] did not satisfy constraint [^0.0.23]"
stack:"Error: optional dependency [kerberos] found but version [0.0.24] did not satisfy constraint [^0.0.23]\n at require_optional (c:\Users\apolkousky\Projects\node.js\kerberos-test\node_modules\require_optional\index.js:109:19)\n at Object.<anonymous> (c:\Users\apolkousky\Projects\node.js\kerberos-test\node_modules\mongodb-core\lib\auth\sspi.js:29:14)\n at Module._compile (module.js:643:30)\n at Object.Module._extensions..js (module.js:654:10)\n at Module.load (module.js:556:32)\n at tryModuleLoad (module.js:499:12)\n at Function.Module._load (module.js:491:3)\n at Module.require (module.js:587:17)\n at require (internal/module.js:11:18)\n at Object.<anonymous> (c:\Users\apolkousky\Projects\node.js\kerberos-test\node_modules\mongodb-core\lib\connection\pool.js:25:10)"
__proto__:Object {constructor: , name: "Error", message: "", …}
Downgrading kerberos to version 0.0.23 solved the issue.

SlimScroll Error: Module build failed at ng2-slimscroll/index.ts

I have followed below steps Source from https://github.com/jkuri/ng2-slimscroll
Installation
npm install ng2-slimscroll
Imported module like
import { SlimScrollModule } from 'ng2-slimscroll';
imports: [ ....................,
SlimScrollModule,
......................]
facing Error in nodemodules/ng2-slimscroll/index.ts like
ERROR in ./~/ng2-slimscroll/index.ts
Module build failed: Error
at new FatalError (E:\ReconWorkspace\AgreeGateway\node_modules\tslint\lib\error.js:40:23)
at Function.findConfiguration (E:\ReconWorkspace\AgreeGateway\node_modules\tslint\lib\configurat
ion.js:47:15)
at resolveOptions (E:\ReconWorkspace\AgreeGateway\node_modules\tslint-loader\index.js:35:64)
at Object.module.exports (E:\ReconWorkspace\AgreeGateway\node_modules\tslint-loader\index.js:124
:17)
# ./src/main/webapp/app/test/test.module.ts 21:23-48
# ./src/main/webapp/app/app.module.ts
# ./src/main/webapp/app/app.main.ts
# multi (webpack)-dev-server/client?http://localhost:9060 webpack/hot/dev-server ./src/main/webapp/
app/app.main

Webpack require() Cannot resolve 'file' or 'directory'

Silly question perhaps but... I'm building on app with Webpack (on Ubuntu), and I'm trying to require a JS file from another. My app looks something like this:
myapp/
src/
vendor/
facebook.js
components/
layout/
header/
FacebookButtonComponent.js
And my Webpack configuration has the following in it:
const path = require('path');
const srcPath = path.join(__dirname, '/src');
resolve: {
extensions: [
'',
'.js',
'.jsx'
],
alias: {
components: `${ srcPath }/components`,
vendor: `${ srcPath }/vendor`
}
}
Then in FacebookComponent.js I'm requiring a facebook.js with:
require('vendor/facebook.js');
However I get the following error:
ERROR in ./src/components/layout/header/FacebookButtonComponent.js
Module not found: Error: Cannot resolve 'file' or 'directory' /myapp/src/vendor/facebook.js in /myapp/src/components/layout/header
Maybe I'm going about this the wrong way, but it seems to be building the correct path. How am I supposed to be formatting my path if this isn't correct?
I've also tried ./ which gives:
ERROR in ./src/components/layout/header/FacebookButtonComponent.js
Module not found: Error: Cannot resolve 'file' or 'directory' ./vendor/facebook.js in myapp/src/components/layout/header
And ../s to build a relative path, which seems to have no effect:
ERROR in ./src/components/layout/header/FacebookButtonComponent.js
Module not found: Error: Cannot resolve 'file' or 'directory' ../vendor/facebook.js in myapp/src/components/layout/header
This question seems somewhat relevant but none of the suggestions there seemed to work (e.g. setting root.)
You can define resolve.modulesDirectories instead of alias:
resolve: {
extensions: [
'',
'.js',
'.jsx'
],
modulesDirectories: [
"node_modules",
"src"
]
}
And require files as it is now:
require('vendor/facebook.js');
In your file tree you got
FacebookComponent.js
And your error says
FacebookButtonComponent.js
Just by reading the errors i think require('../../../vendor/facebook.js') should work.
require('vendor/facebook.js');
ERROR in ./src/components/layout/header/FacebookButtonComponent.js Module not found: Error: Cannot resolve 'file' or 'directory' /myapp/src/vendor/facebook.js in /myapp/src/components/layout/header Maybe I'm going about
=> trying to resolve /myapp/src/components/layout/header/myapp/src/vendor/facebook.js
require('./vendor/facebook.js');
ERROR in ./src/components/layout/header/FacebookButtonComponent.js Module not found: Error: Cannot resolve 'file' or 'directory' ./vendor/facebook.js in myapp/src/components/layout/header
=> trying to resolve /myapp/src/components/layout/header/vendor/facebook.js
require('../vendor/facebook.js');
ERROR in ./src/components/layout/header/FacebookButtonComponent.js Module not found: Error: Cannot resolve 'file' or 'directory' ../vendor/facebook.js in myapp/src/components/layout/header
=> trying to resolve myapp/src/components/layout/vendor/facebbok.js

Resources