I reinstalled windows recently and have been facing this issue with angular since then.
My old projects are running fine, but when I create new project I am getting the following error.
I have tried to install angular CLI and Node.js again, I also reinstalled VS code.
I have tried adding the paths in the tsconfig.app.json file.
At this point, I am totally clueless.
PS D:\C#LTI\WebApi\new_project_angular> ng build
✔ Browser application bundle generation complete.
Warning: ▲ [WARNING] Comments in CSS use "/* ... */" instead of "//"
D:/C#LTI/WebApi/new_project_angular/src/app/app.component.css:1:18:
1 │ /******/ (() => { // webpackBootstrap
╵ ~~
Warning: ▲ [WARNING] Unexpected "("
D:/C#LTI/WebApi/new_project_angular/src/app/app.component.css:1:9:
1 │ /******/ (() => { // webpackBootstrap
╵ ^
../../../C#LTI/WebApi/new_project_angular/src/environments/environment.ts - Error: Module build failed (from ./node_modules/#ngtools/webpack/src/ivy/index.js):
Error: D:\C#LTI\WebApi\new_project_angular\src\environments\environment.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
at D:\C#LTI\WebApi\new_project_angular\node_modules#ngtools\webpack\src\ivy\loader.js:64:26
Error: Module not found: Error: Can't resolve 'D:/C#LTI/WebApi/new_project_angular/src/app/app.component.css?ngResource' in 'D:\C#LTI\WebApi\new_project_angular'
Error: The loader "D:/C#LTI/WebApi/new_project_angular/src/app/app.component.css" didn't return a string.
Related
I have a react app and all of a sudden I got the below errors while I run npm start:
ERROR in ./node_modules/sass/sass.dart.js 118:12-25
Module not found: Error: Can't resolve 'fs' in .......
webpack compiled with 1 error and 1 warning
I manage to handle it with adding fallback to webpack.config.js like below:
.....
resolve: {
// This allows you to set a fallback for where webpack should look for modules.
// We placed these paths second because we want `node_modules` to "win"
// if there are any conflicts. This matches Node resolution mechanism.
// https://github.com/facebook/create-react-app/issues/253
fallback:{
"fs":false
},
}
it solved the problem but I don't want to override webpack.config.js because if I remove my node modules and some one else tries to npm install then he will get the error again.
how can I solve the error without overriding webpack.config.js?
I'm using cloudflare page template and I don't import #remix-run/node anywhere.
Also package.json file doesn't involve #remix-run/node
But after yarn install, #remix-run/node is created and when I try to compile then an error occurs.
X [ERROR] Could not resolve "fs/promises"
node_modules/#remix-run/node/upload/fileUploadHandler.js:17:23:
17 │ var promises = require('fs/promises');
╵ ~~~~~
The package "fs/promises" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
How can I resolve this problem?
Encountered this myself, trying this
https://reactjsexample.com/an-example-of-prisma-working-on-cloudflare-pages-with-remix/
I'm new with configuring stuff with Rollup, I'm trying to configure a node CLI app to be bundled in a single cli.bundle.js file that would be executable with a simple node cli.bundle.js without needing to npm install anything before.
On a side note, we already have succeed in doing so with zeit/pkg, but we would rather note have all the nodejs executable bundled inside, so we are trying work with rollup instead of pkg.
The problem we encounter is that when going through the different node_modules of the application, rollup.js crash with error:
[!] Error: Identifier 'Reader' has already been declared
../../common/js-common/node_modules/fstream/lib/file-reader.js (7:4)
5: var fs = require("graceful-fs")
6: , fstream = require("../fstream.js")
7: , Reader = fstream.Reader
^
8: , inherits = require("inherits")
9: , mkdir = require("mkdirp")
Error: Identifier 'Reader' has already been declared
at error (/home/.../src/external-data/external-data-etl/node_modules/rollup/dist/shared/node-entry.js:5400:30)
at Module.error (/home/.../src/external-data/external-data-etl/node_modules/rollup/dist/shared/node-entry.js:9820:16)
at tryParse (/home/.../src/external-data/external-data-etl/node_modules/rollup/dist/shared/node-entry.js:9713:23)
at Module.setSource (/home/.../src/external-data/external-data-etl/node_modules/rollup/dist/shared/node-entry.js:10076:33)
at Promise.resolve.catch.then.then.then (/home/.../src/external-data/external-data-etl/node_modules/rollup/dist/shared/node-entry.js:12362:20)
While looking for this error with rollup, it seems people were having it more at execution time than at bundle time, so I have no clue of what I can do. This duplicated identifier is in a 3rd party code I don't control :(
Here is my rollup.config.js
Edit: I tried with the new #rollup/plugins to see if there were a fix in them, but I have still the same issue.
import commonjs from '#rollup/plugin-commonjs';
import resolve from '#rollup/plugin-node-resolve';
import json from '#rollup/plugin-json';
export default {
input: 'dist/index.js',
output: {
format: 'cjs',
file: './cli.bundle.js'
},
plugins: [
commonjs(),
resolve(),
json() // asked and added when parsing 'got' package imported by 'download' package
]
};
And our building process is :
transpile from typescript (src) to js (dist) with tsc
bundle (dist) app into single runnable file
We would rather not include babel or typescript plugin to transpile, to stay independant, and certainly the (dist) app is enough (as it was enough for zeit/pkg).
Is there something we are doing wrong ?
The Problem is your dependency it is not coded in the right way you will need to correct the code error they did.
I am using the api from musixmatch-sdk and have an error by building my project with webpack.
I am using webpack 2, react, node.
The default import on the musixmatch site is:
var MusixmatchApi = require('../../build/javascript-client/src/index');
But this does't work and getting this error:
ERROR in ./build/javascript-client/src/index.js<br/>
Module not found: Error: Can't resolve 'ApiClient' in '/Users/myname/lyrix/build/javascript-client/src'<br/>
# ./build/javascript-client/src/index.js 28:4-2099<br/>
# ./src/server.js
So I have wrote it with an absolute path like:
const MusixmatchApi = require(path.join(__dirname,'../build/javascript-client/src/index'));
This works in development mode of webpack, but i get this warning:
WARNING in ./src/server.js
33:20-102 Critical dependency: the request of a dependency is an expression
# ./src/server.js
So if I want to build the production project i get the error:
Error: Cannot find module "."<br/>
at /Users/myname/lyrix/src/server-es5.js:1:16712<br/>
at Object.<anonymous> (/Users/myname/lyrix/src/server-es5.js:1:16782)
Can you please help me?
When I run aurelia's bundler I get the following error:
D:\Code\Test>aurelia bundle
info: Using Aureliafile: D:\Code\Test\aureliafile.js
info: Creating bundle ...
Potentially unhandled rejection [6] Error: Error loading "aurelia-cli" at file:D:/Code/Test/aurelia-cli.js
Error loading "aurelia-cli" from "aureliafile" at file:D:/Code/Test/aureliafile.js
ENOENT, open 'D:\Code\Test\aurelia-cli.js'
at Error (native)
The problem is a combination of having set "*" : "*.js" in System.Config and using the "*" wildcard telling aurelia bundle to pull in everything. This turns out to try to include the project root files. You can either be more specific to the bundler:
aureliafile.js:
"dist/app-bundle": {
modules: [
'dist/*',
...
or reapply the jspm mapping "*" : "dist/*.js". Unfortunatly what I need is actually one configuration during development (bundling) and another during production (serving).
related issues:
https://github.com/aurelia/cli/issues/112
https://github.com/aurelia/cli/issues/116