I was building a theme with sage and copy the folder to another location. After that when I try to build the project I get this error:
Module build failed: ModuleBuildError: Module build failed: Invalid UTF-8
at runLoaders (/var/www/html/plataforma/wp-content/themes/template-mnm/node_modules/webpack/lib/NormalModule.js:195:19)
at /var/www/html/plataforma/wp-content/themes/template-mnm/node_modules/loader-runner/lib/LoaderRunner.js:364:11
at /var/www/html/plataforma/wp-content/themes/template-mnm/node_modules/loader-runner/lib/LoaderRunner.js:230:18
at context.callback (/var/www/html/plataforma/wp-content/themes/template-mnm/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
at Object.asyncSassJobQueue.push [as callback] (/var/www/html/plataforma/wp-content/themes/template-mnm/node_modules/sass-loader/lib/loader.js:55:13)
at Object. (/var/www/html/plataforma/wp-content/themes/template-mnm/node_modules/async/dist/async.js:2244:31)
at Object.callback (/var/www/html/plataforma/wp-content/themes/template-mnm/node_modules/async/dist/async.js:906:16)
at options.error (/var/www/html/plataforma/wp-content/themes/template-mnm/node_modules/node-sass/lib/index.js:294:32)
# multi ./scripts/main.js ./styles/main.scss
error in ./resources/assets/styles/main.scss
Module build failed: ModuleBuildError: Module build failed: Invalid UTF-8
at runLoaders (/var/www/html/plataforma/wp-content/themes/template-mnm/node_modules/webpack/lib/NormalModule.js:195:19)
at /var/www/html/plataforma/wp-content/themes/template-mnm/node_modules/loader-runner/lib/LoaderRunner.js:364:11
at /var/www/html/plataforma/wp-content/themes/template-mnm/node_modules/loader-runner/lib/LoaderRunner.js:230:18
at context.callback (/var/www/html/plataforma/wp-content/themes/template-mnm/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
at Object.asyncSassJobQueue.push [as callback] (/var/www/html/plataforma/wp-content/themes/template-mnm/node_modules/sass-loader/lib/loader.js:55:13)
at Object. (/var/www/html/plataforma/wp-content/themes/template-mnm/node_modules/async/dist/async.js:2244:31)
at Object.callback (/var/www/html/plataforma/wp-content/themes/template-mnm/node_modules/async/dist/async.js:906:16)
at options.error (/var/www/html/plataforma/wp-content/themes/template-mnm/node_modules/node-sass/lib/index.js:294:32)
I think the encoding of the files have changed, is there a way to correct the problem?
I really apreciate any help, Thanks!
So I've found the answer and I will post it in case anyone has the same problem. The things was one of the scss files imported inside main.scss had the wrong encoding.
Saving the file with the correct encoding solved the problem.
Related
I just encountered this error while navigating to different links using NextJs's Link Component; Once this error showed up, I couldn't access any pages until I restarted the npm run build command, and everything worked properly again.
However, I can't figure out what caused this error and I wanted to make sure this doesn't happen in my production app. Does anyone have an idea what might have caused this error?
Error: Cannot find module './undefined'
Require stack:
- /Users/tylerkim/Documents/GitHub/scraft/scraft-app/.next/server/webpack-runtime.js
- /Users/tylerkim/Documents/GitHub/scraft/scraft-app/.next/server/pages/_document.js
- /Users/tylerkim/Documents/GitHub/scraft/scraft-app/node_modules/next/dist/server/require.js
- /Users/tylerkim/Documents/GitHub/scraft/scraft-app/node_modules/next/dist/server/load-components.js
- /Users/tylerkim/Documents/GitHub/scraft/scraft-app/node_modules/next/dist/build/utils.js
- /Users/tylerkim/Documents/GitHub/scraft/scraft-app/node_modules/next/dist/build/output/store.js
- /Users/tylerkim/Documents/GitHub/scraft/scraft-app/node_modules/next/dist/build/output/index.js
- /Users/tylerkim/Documents/GitHub/scraft/scraft-app/node_modules/next/dist/cli/next-dev.js
- /Users/tylerkim/Documents/GitHub/scraft/scraft-app/node_modules/next/dist/bin/next
at Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
at mod._resolveFilename (/Users/tylerkim/Documents/GitHub/scraft/scraft-app/node_modules/next/dist/build/webpack/require-hook.js:183:28)
at Module._load (node:internal/modules/cjs/loader:804:27)
at Module.require (node:internal/modules/cjs/loader:1022:19)
at require (node:internal/modules/cjs/helpers:102:18)
at __webpack_require__.f.require (/Users/tylerkim/Documents/GitHub/scraft/scraft-app/.next/server/webpack-runtime.js:233:28)
at /Users/tylerkim/Documents/GitHub/scraft/scraft-app/.next/server/webpack-runtime.js:160:40
at Array.reduce (<anonymous>)
at __webpack_require__.e (/Users/tylerkim/Documents/GitHub/scraft/scraft-app/.next/server/webpack-runtime.js:159:67)
at Array.map (<anonymous>) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/tylerkim/Documents/GitHub/scraft/scraft-app/.next/server/webpack-runtime.js',
'/Users/tylerkim/Documents/GitHub/scraft/scraft-app/.next/server/pages/_document.js',
'/Users/tylerkim/Documents/GitHub/scraft/scraft-app/node_modules/next/dist/server/require.js',
'/Users/tylerkim/Documents/GitHub/scraft/scraft-app/node_modules/next/dist/server/load-components.js',
'/Users/tylerkim/Documents/GitHub/scraft/scraft-app/node_modules/next/dist/build/utils.js',
'/Users/tylerkim/Documents/GitHub/scraft/scraft-app/node_modules/next/dist/build/output/store.js',
'/Users/tylerkim/Documents/GitHub/scraft/scraft-app/node_modules/next/dist/build/output/index.js',
'/Users/tylerkim/Documents/GitHub/scraft/scraft-app/node_modules/next/dist/cli/next-dev.js',
'/Users/tylerkim/Documents/GitHub/scraft/scraft-app/node_modules/next/dist/bin/next'
]
}
error - Error: Cannot find module './undefined'
You're trying to import a page called undefined in /pages/_document.js, which I imagine isn't what you really want to do.
Can you add your _document page import code?
I'm trying to learn about the Meteor build process to improve it's performance for my dockerized Meteor app. I'm finding that if I run meteor build build --directory --server-only twice, back to back, I get an error about not being able to parse json on the second run.
Here's the successful first run:
❯❯❯ meteor build build --directory --server-only
WARNING: The output directory is under your source tree.
Your generated files may get interpreted as source code!
Consider building into a different directory instead
meteor build ../output
WARNING: npm peer requirements (for juliancwirko:postcss) not installed:
- postcss#8.2.6 installed, postcss#^7.0.0 needed
- postcss-load-config#3.0.1 installed, postcss-load-config#^2.1.0 needed
Read more about installing npm peer dependencies:
http://guide.meteor.com/using-packages.html#peer-npm-dependencies
Minifying app stylesheet /
Replace Autoprefixer browsers option to Browserslist config.
Use browserslist key in package.json or .browserslistrc file.
Using browsers option can cause errors. Browserslist config can
be used for Babel, Autoprefixer, postcss-normalize and other tools.
If you really need to use option, rename it to overrideBrowserslist.
Learn more at:
https://github.com/browserslist/browserslist#readme
https://twitter.com/browserslist
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist#latest --update-db
Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist#latest --update-db
Minifying app code \
and here's the unsuccessful second run. Note that I didn't do anything inbetween runs:
❯❯❯ meteor build build --directory --server-only
WARNING: The output directory is under your source tree.
Your generated files may get interpreted as source code!
Consider building into a different directory instead
meteor build ../output
WARNING: npm peer requirements (for juliancwirko:postcss) not installed:
- postcss#8.2.6 installed, postcss#^7.0.0 needed
- postcss-load-config#3.0.1 installed, postcss-load-config#^2.1.0 needed
Read more about installing npm peer dependencies:
http://guide.meteor.com/using-packages.html#peer-npm-dependencies
/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/meteor-promise/promise_server.js:
218
throw error;
^
SyntaxError: Unexpected token u in JSON at position 1
at JSON.parse (<anonymous>)
at /home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/fs/tools/fs/optimistic.ts:321:17
at wrap.makeCacheKey (/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/fs/tools/fs/optimistic.ts:36:
15)
at recomputeNewValue (/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/optimis
m/src/entry.ts:182:31)
at Slot.withValue (/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/#wry/conte
xt/lib/context.js:73:29)
at reallyRecompute (/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/optimism/
src/entry.ts:165:19)
at Entry.recompute (/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/optimism/
src/entry.ts:85:9)
at optimistic (/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/optimism/src/i
ndex.ts:101:25)
at /home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/fs/tools/fs/optimistic.ts:366:19
at recomputeNewValue (/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/optimis
m/src/entry.ts:182:31)
at Slot.withValue (/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/#wry/conte
xt/lib/context.js:73:29)
at reallyRecompute (/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/optimism/
src/entry.ts:165:19)
at Entry.recompute (/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/optimism/
src/entry.ts:85:9)
at optimistic (/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/optimism/src/i
ndex.ts:101:25)
at find (/tools/isobuild/package-source.js:1339:30)
at /tools/isobuild/package-source.js:1395:27
at Array.forEach (<anonymous>)
at find (/tools/isobuild/package-source.js:1374:22)
at find (/tools/isobuild/package-source.js:1406:25)
at /tools/isobuild/package-source.js:1395:27
at Array.forEach (<anonymous>)
at find (/tools/isobuild/package-source.js:1374:22)
at /tools/isobuild/package-source.js:1395:27
at Array.forEach (<anonymous>)
at find (/tools/isobuild/package-source.js:1374:22)
at /tools/isobuild/package-source.js:1395:27
at Array.forEach (<anonymous>)
at find (/tools/isobuild/package-source.js:1374:22)
at /tools/isobuild/package-source.js:1395:27
at Array.forEach (<anonymous>)
at find (/tools/isobuild/package-source.js:1374:22)
at /tools/isobuild/package-source.js:1395:27
at Array.forEach (<anonymous>)
at find (/tools/isobuild/package-source.js:1374:22)
at /tools/isobuild/package-source.js:1418:34
at Object.withCache (/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/fs/tools/fs/files.ts:1663:18)
at PackageSource._findSources (/tools/isobuild/package-source.js:1418:18)
at SourceArch.getFiles (/tools/isobuild/package-source.js:960:32)
at /tools/isobuild/compiler.js:406:23
at /tools/isobuild/compiler.js:186:28
at Object.withCache (/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/fs/tools/fs/files.ts:1663:18)
at /tools/isobuild/compiler.js:185:11
at Function._.each._.forEach (/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules
/underscore/underscore.js:186:9)
at Object.compile (/tools/isobuild/compiler.js:180:5)
at /tools/isobuild/bundler.js:3268:24
at Object.capture (/tools/utils/buildmessage.js:283:5)
at bundle (/tools/isobuild/bundler.js:3214:31)
at /tools/isobuild/bundler.js:3157:32
at Slot.withValue (/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/#wry/conte
xt/lib/context.js:73:29)
at Object.withCache (/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/fs/tools/fs/files.ts:1663:39)
at Object.bundle (/tools/isobuild/bundler.js:3157:16)
at buildCommand (/tools/cli/commands.js:1082:30)
at /tools/cli/commands.js:945:25
at Function.run (/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/tool-env/tools/tool-env/profile.ts
:289:14)
at /tools/cli/commands.js:943:18
at /home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/meteor-promise/fiber_pool.
js:43:40
=> awaited here:
at Promise.await (/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/meteor-prom
ise/promise_server.js:60:12)
at /tools/cli/main.js:1529:7
I've also tried doing the second run with a different directory output, but get the same result:
❯❯❯ meteor build .. --directory --server-only
WARNING: npm peer requirements (for juliancwirko:postcss) not installed:
- postcss#8.2.6 installed, postcss#^7.0.0 needed
- postcss-load-config#3.0.1 installed, postcss-load-config#^2.1.0 needed
Read more about installing npm peer dependencies: http://guide.meteor.com/using-packages.html#peer-npm-dependencies
/home/paymahn1/.meteor/packages/meteor-tool/.2.1.0.udr5f0.57lxg++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/meteor-promise/promise_server.js:
218
throw error;
^
SyntaxError: Unexpected token u in JSON at position 1
at JSON.parse (<anonymous>)
Why does meteor fail to build if I try to build it twice back to back?
What happens is that you produce your built app but not bundle it (using the --directory flag).
Therefore you have extra JS files in your file structure.
And in your attempts, they are mixed with your Meteor project structure, in a build folder (when you use command meteor build build --directory) or directly merged (meteor build .. --directory).
Therefore, on the next build run, Meteor picks these extra JS files as if they were part of your source code (eager loading), and fails, as suggested in the warning message:
The output directory is under your source tree.
Your generated files may get interpreted as source code!
Consider building into a different directory instead
meteor build ../output
It would have worked in your next attempt if you had specified an explicit sibling build folder, instead of just the parent folder (which therefore puts files directly in your Meteor project root), e.g. meteor build ../siblingFolder
Another possible workaround is to use a build folder name starting with a dot ., so that Meteor ignores it on the next runs when it looks for source code, e.g. meteor build ./.build
See special directories docs:
The following directories are also not loaded as part of your app code:
Files/directories whose names start with a dot, like .meteor and .git
I have ANTLR to generate parser/lexer code in "./gen" directory.
With sbt, everything works fine; no issue with compile and test.
However, when I executed doc to invoke scaladoc, I have error messages saying that it cannot find the object that ANTLR generated.
> doc
[info] Main Scala API documentation to /Users/smcho/github/ChitchatCompilerScala/doc/api...
[error] /Users/smcho/github/ChitchatCompilerScala/src/main/scala/node/NodeGenerator.scala:6: not found: object parser
[error] import parser.{ChitchatLexer, ChitchatParser}
[error] ^
What might be wrong?
I had to teach sbt about the new source directory.
unmanagedSourceDirectories in Compile += baseDirectory.value / "extra-src"
Hint from http://www.scala-sbt.org/0.13/docs/Howto-Customizing-Paths.html
I have tried uses-library clause but that gives me this error : Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY
I tried adding the library android-async-http-1.3.2.jar to both the lib folder and as a user library. There are no compile time errors but during run time it doesn't seem to find the library for some strange reason.
This is the error log :
06-01 14:29:57.073: E/AndroidRuntime(5354): FATAL EXCEPTION: main
06-01 14:29:57.073: E/AndroidRuntime(5354): java.lang.NoClassDefFoundError: com.loopj.android.http.RequestParams
06-01 14:29:57.073: E/AndroidRuntime(5354): at com.android.myprojectname
Check that .jar is checked in the tab "Order and Export" in the window "Java build path".
If it doesn't work, add your folder "libs" in "Source" tab.
The jar file should be in the libs folder not the lib folder, try that.
Also, make sure you are importing the classes for use in your code:
import com.loopj.android.http.*;
I am getting the following massage in the error log files of my WordPress blogs:
[10-Oct-2010 04:37:43] PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-zts-20060613/pdo.so' - /usr/local/lib/php/extensions/no-debug-zts-20060613/pdo.so: undefined symbol: compiler_globals_id in Unknown on line 0
[10-Oct-2010 04:37:43] PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-zts-20060613/pdo_sqlite.so' - /usr/local/lib/php/extensions/no-debug-zts-20060613/pdo_sqlite.so: undefined symbol: php_pdo_register_driver in Unknown on line 0
What does it mean?
The php configuration is broken or you deleted the php.ini file. Check your php install, check php.ini, or ask your webhost.