So this is the error I am getting
ApiError: Syntax error: Missing whitespace between literal and alias at [2:18]
1|index | at new ApiError (/home/sahil_bswgames_com/LudoRConfData/node_modules/#google-cloud/common/build/src/util.js:75:15)
1|index | at /home/sahil_bswgames_com/LudoRConfData/node_modules/#google-cloud/bigquery/build/src/bigquery.js:1074:23
1|index | at /home/sahil_bswgames_com/LudoRConfData/node_modules/#google-cloud/common/build/src/util.js:412:25
1|index | at Util.handleResp (/home/sahil_bswgames_com/LudoRConfData/node_modules/#google-cloud/common/build/src/util.js:161:9)
1|index | at /home/sahil_bswgames_com/LudoRConfData/node_modules/#google-cloud/common/build/src/util.js:534:22
1|index | at onResponse (/home/sahil_bswgames_com/LudoRConfData/node_modules/retry-request/index.js:240:7)
1|index | at /home/sahil_bswgames_com/LudoRConfData/node_modules/teeny-request/build/src/index.js:226:13
1|index | at processTicksAndRejections (internal/process/task_queues.js:97:5) {
1|index | code: undefined,
1|index | errors: [
1|index | {
1|index | reason: 'invalidQuery',
1|index | location: 'query',
1|index | message: 'Syntax error: Missing whitespace between literal and alias at [2:18]'
1|index | }
1|index | ],
and following is my query
SELECT assetId, date, uniqueUsers as uniqueUsershavingP1 FROM table WHERE date between '2022-10-01' and '2022-10-25" and event= "abc"
What is wrong in this query, because query is running perfectly on local but not on prod
I have tried to put table name in quotes as suggested by many articles bt that did'nt work either
Related
I'm trying to use the #cucumber/monaco editor library in a React project which uses tree-sitter for NodeParserAdapter but I'm getting a bunch of resolve errors in the tree-sitter when I do this. I'm importing the NodeParserAdapter, not the WasmParserAdapter from the cucumber/language-service as we aren't using WebAssembly in our project.
Environment: Node v16.17.1 (Docker Image 16.17)
Error Log:
[0]
[0] Search for the keywords to learn more about each warning.
[0] To ignore, add // eslint-disable-next-line to the line before.
[0]
[0] WARNING in ./node_modules/tree-sitter-c-sharp/bindings/node/index.js 2:2-77
[0] Module not found: Error: Can't resolve '../../build/Release/tree_sitter_c_sharp_binding' in '/usr/src/my_project/node_modules/tree-sitter-c-sharp/bindings/node'
[0]
[0] WARNING in ./node_modules/tree-sitter-c-sharp/bindings/node/index.js 9:4-77
[0] Module not found: Error: Can't resolve '../../build/Debug/tree_sitter_c_sharp_binding' in '/usr/src/my_project/node_modules/tree-sitter-c-sharp/bindings/node'
[0]
[0] WARNING in ./node_modules/tree-sitter-java/bindings/node/index.js 2:2-74
[0] Module not found: Error: Can't resolve '../../build/Release/tree_sitter_java_binding'
in '/usr/src/my_project/node_modules/tree-sitter-java/bindings/node'
[0]
[0] WARNING in ./node_modules/tree-sitter-java/bindings/node/index.js 9:4-74
[0] Module not found: Error: Can't resolve '../../build/Debug/tree_sitter_java_binding' in '/usr/src/my_project/node_modules/tree-sitter-java/bindings/node'
[0]
[0] WARNING in ./node_modules/tree-sitter-php/index.js 2:2-69
[0] Module not found: Error: Can't resolve './build/Release/tree_sitter_php_binding' in '/usr/src/my_project/node_modules/tree-sitter-php'
[0]
[0] WARNING in ./node_modules/tree-sitter-php/index.js 5:4-69
[0] Module not found: Error: Can't resolve './build/Debug/tree_sitter_php_binding' in '/usr/src/my_project/node_modules/tree-sitter-php'
[0]
[0] WARNING in ./node_modules/tree-sitter-python/bindings/node/index.js 2:2-76
[0] Module not found: Error: Can't resolve '../../build/Release/tree_sitter_python_binding' in '/usr/src/my_project/node_modules/tree-sitter-python/bindings/node'
[0]
[0] WARNING in ./node_modules/tree-sitter-python/bindings/node/index.js 9:4-76
[0] Module not found: Error: Can't resolve '../../build/Debug/tree_sitter_python_binding'
in '/usr/src/my_project/node_modules/tree-sitter-python/bindings/node'
[0]
[0] WARNING in ./node_modules/tree-sitter-ruby/bindings/node/index.js 2:2-74
[0] Module not found: Error: Can't resolve '../../build/Release/tree_sitter_ruby_binding'
in '/usr/src/my_project/node_modules/tree-sitter-ruby/bindings/node'
[0]
[0] WARNING in ./node_modules/tree-sitter-ruby/bindings/node/index.js 9:4-74
[0] Module not found: Error: Can't resolve '../../build/Debug/tree_sitter_ruby_binding' in '/usr/src/my_project/node_modules/tree-sitter-ruby/bindings/node'
[0]
[0] WARNING in ./node_modules/tree-sitter-typescript/bindings/node/index.js 2:2-80
[0] Module not found: Error: Can't resolve '../../build/Release/tree_sitter_typescript_binding' in '/usr/src/my_project/node_modules/tree-sitter-typescript/bindings/node'
[0]
[0] WARNING in ./node_modules/tree-sitter-typescript/bindings/node/index.js 9:4-80
[0] Module not found: Error: Can't resolve '../../build/Debug/tree_sitter_typescript_binding' in '/usr/src/my_project/node_modules/tree-sitter-typescript/bindings/node'
[0]
[0] WARNING in ./node_modules/tree-sitter/index.js 4:12-66
[0] Module not found: Error: Can't resolve './build/Release/tree_sitter_runtime_binding' in '/usr/src/my_project/node_modules/tree-sitter'
[0]
[0] WARNING in ./node_modules/tree-sitter/index.js 7:14-66
[0] Module not found: Error: Can't resolve './build/Debug/tree_sitter_runtime_binding' in
'/usr/src/my_project/node_modules/tree-sitter'
[0]
[0] webpack compiled with 14 warnings
Tree Sitter and the other tree-sitter-c-sharp, tree-sitter-java etc are all installed and in the node_modules directory of the project.
tree-sitter
tree-sitter-c-sharp
tree-sitter-cli
tree-sitter-java
tree-sitter-php
tree-sitter-python
tree-sitter-ruby
tree-sitter-typescript
And when I look in the tree-sitter/build/Release I can see the tree_sitter_runtime_binding.node file
root#abc123:/usr/src/my_project/node_modules/tree-sitter/build/Release# ls
obj.target tree_sitter.a tree_sitter_runtime_binding.node
So why can't tree-sitter resolve it?
Have tried Node 18, that didn't work, tried running the build command directly from the node_modules/tree-sitter directory, didn't work, have tried installing tree-sitter in a new folder on it's own and getting the same error. Any help much appreciated.
✅ What did you expect to see?
The tree-sitter package to resolve correctly and for the Monaco editor to work with the #cucumber/monaco library.
📦 Which tool/library version are you using?
+-- #cucumber/monaco#0.11.0
| +-- #cucumber/language-service#0.32.0
| | +-- #cucumber/cucumber-expressions#16.0.0
| | +-- #cucumber/gherkin-utils#8.0.0
| | +-- #cucumber/gherkin#24.0.0
| | +-- #cucumber/messages#19.1.4
| | +-- #types/js-search#1.4.0
| | +-- #types/mustache#4.2.1
| | +-- fuse.js#6.6.2
| | +-- js-search#2.0.0
| | +-- mustache#4.2.0
| | +-- tree-sitter-c-sharp#0.19.1
| | +-- tree-sitter-cli#0.20.6
| | +-- tree-sitter-java#0.19.1
| | +-- tree-sitter-php#0.19.0
| | +-- tree-sitter-python#0.20.1
| | +-- tree-sitter-ruby#0.19.0
| | +-- tree-sitter-typescript#0.20.1
| | +-- tree-sitter#0.20.0
| | +-- vscode-languageserver-types#3.17.2
| | `-- web-tree-sitter#0.20.5
| +-- monaco-editor#0.33.0
| `-- vscode-languageserver-types#3.17.2
Node.js 16.17.1, tried with later versions of Node but to no success.
React 18.2
🔬 How could we reproduce it?
Steps to reproduce the behavior:
Start a node:16.17 Docker container
Create a React project using the Create React App template
Install the Monaco editor library and #cucumber/monaco library
Create a TestEditor.jsx file
Import the NodeParserAdapter into the file
Bug should reproduce
Below is the code snippet I'm trying to run.
import React from 'react'
// Import the components
import VerticalNav from '../../components/navbar/VerticalNav'
import HorizontalNav from '../../components/navbar/HorizontalNav'
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api'
import MonacoEditor from '#monaco-editor/react'
import { configureMonaco } from '#cucumber/monaco'
import { ParameterTypeRegistry } from '#cucumber/cucumber-expressions'
import {
buildSuggestions,
ExpressionBuilder,
jsSearchIndex,
} from '#cucumber/language-service'
import { NodeParserAdapter } from '#cucumber/language-service/node'
import { render } from 'react-dom'
const value = `#foo
Feature: Hello
Scenario: Hi
Given I have 58 cukes in my belly
And this is an undefined step
| some | poorly |
| formatted | table |
`
async function Editor() {
monaco.languages.register({ id: 'typescript' })
const sources = [
{
languageName: 'java',
uri: 'file:///tmp/StepDefinitions.java',
content: `class StepDefinitions {
#Given("I have {int} cukes in my belly" )
void method1() {
}
#Given("there are {int} blind mice")
void method2() {
}
#Given("there is/are some/none/1 apple(s)")
void method2() {
}
}
`,
},
]
const adapter = new NodeParserAdapter('.')
await adapter.init()
const expressionBuilder = new ExpressionBuilder(adapter)
const { expressionLinks } = expressionBuilder.build(sources, [])
const expressions = expressionLinks.map((link) => link.expression)
const registry = new ParameterTypeRegistry()
const docs = buildSuggestions(
registry,
[
'I have 42 cukes in my belly',
'I have 96 cukes in my belly',
'there are 38 blind mice',
],
expressions,
)
const index = jsSearchIndex(docs)
return configureMonaco(monaco, index, expressions)
}
export default function EditorElement() {
const options = {
value,
language: 'gherkin',
theme: 'vs-dark',
// semantic tokens provider is disabled by default
'semanticHighlighting.enabled': true,
}
Editor()
.then((configureEditor) => {
// #ts-ignore
console.log('Hello World')
render(
<MonacoEditor
height="90vh"
options={options}
className="editor"
configure={configureEditor}
/>,
document.getElementById('editor'),
)
})
.catch((err) => console.error(err.stack))
return (
<>
<div className="flex">
<VerticalNav />
<div className="h-screen flex-1">
<HorizontalNav />
<div className="pt-9 w-[90%] m-auto">
<div id="editor"></div>
</div>
</div>
</div>
</>
)
}
I tried following the example in the try folder, just replacing the WasmParserAdapter with the NodeParserAdapter but then I couldn't get any further with the resolve errors.
Not sure if this is a problem with the tree-sitter library or a React project configuration problem. Tried a few solutions online but nothing seems to work. Any advice or help is much appreciated
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
These is a long page full for error messages and I cannot get hold of the person teaching this class been 2 weeks. I tried redoing it but I still got the same messages I do not know how or what to do in order to fix them. Here is the git hub link: https://github.com/SadiaSanam/petshop
And these are the messages, how to I fix it? Because some of those pages I cannot even find..
TypeError: path.split is not a function
get
C:/Users/sadia/OneDrive/SheCodes/Full stack/app/src/utils/get.ts:6
TypeError: path.split is not a function
get
C:/Users/sadia/OneDrive/SheCodes/Full stack/app/src/utils/get.ts:6
3 | import isUndefined from './isUndefined';
4 |
5 | export default (obj: any = {}, path: string, defaultValue?: unknown) => {
> 6 | const result = compact(path.split(/[,[\].]+?/)).reduce(
7 | (result, key) => (isNullOrUndefined(result) ? result : result[key]),
8 | obj,
9 | );
View compiled
(anonymous function)
C:/Users/sadia/OneDrive/SheCodes/Full stack/app/src/useForm.ts:967
964 |
965 | const register: UseFormRegister<TFieldValues> = React.useCallback(
966 | (name, options) => {
> 967 | const isInitialRegister = !get(fieldsRef.current, name);
| ^ 968 |
969 | set(fieldsRef.current, name, {
970 | _f: {
View compiled
Login
C:/Users/sadia/OneDrive/SheCodes/Full stack/app/petshop/src/components/Login.js:88
85 | <div className='form-control'>
86 |
87 | <label htmlFor='email'>Email</label>
> 88 | <input type='email' name='email' id='email' ref={register( {required:true}) } />
| ^ 89 | { errors.email ? <span className='err'> email is required!</span> : null }
90 |
91 | <label htmlFor='password'>Password</label>
View compiled
renderWithHooks
C:/Users/sadia/OneDrive/SheCodes/Full stack/app/petshop/node_modules/react-dom/cjs/react-dom.development.js:14985
14982 | }
14983 | }
14984 |
> 14985 | var children = Component(props, secondArg); // Check if there was a render phase update
| ^ 14986 |
14987 | if (didScheduleRenderPhaseUpdateDuringThisPass) {
14988 | // Keep rendering in a loop for as long as render phase updates continue to
View compiled
mountIndeterminateComponent
C:/Users/sadia/OneDrive/SheCodes/Full stack/app/petshop/node_modules/react-dom/cjs/react-dom.development.js:17811
17808 |
17809 | setIsRendering(true);
17810 | ReactCurrentOwner$1.current = workInProgress;
> 17811 | value = renderWithHooks(null, workInProgress, Component, props, context, renderLanes);
| ^ 17812 | setIsRendering(false);
17813 | } // React DevTools reads this flag.
17814 |
View compiled
beginWork
C:/Users/sadia/OneDrive/SheCodes/Full stack/app/petshop/node_modules/react-dom/cjs/react-dom.development.js:19049
19046 | switch (workInProgress.tag) {
19047 | case IndeterminateComponent:
19048 | {
> 19049 | return mountIndeterminateComponent(current, workInProgress, workInProgress.type, renderLanes);
| ^ 19050 | }
19051 |
19052 | case LazyComponent:
View compiled
HTMLUnknownElement.callCallback
C:/Users/sadia/OneDrive/SheCodes/Full stack/app/petshop/node_modules/react-dom/cjs/react-dom.development.js:3945
3942 | function callCallback() {
3943 | didCall = true;
3944 | restoreAfterDispatch();
> 3945 | func.apply(context, funcArgs);
| ^ 3946 | didError = false;
3947 | } // Create a global error event handler. We use this to capture the value
3948 | // that was thrown. It's possible that this error handler will fire more
View compiled
invokeGuardedCallbackDev
C:/Users/sadia/OneDrive/SheCodes/Full stack/app/petshop/node_modules/react-dom/cjs/react-dom.development.js:3994
3991 | // errors, it will trigger our global error handler.
3992 |
3993 | evt.initEvent(evtType, false, false);
> 3994 | fakeNode.dispatchEvent(evt);
| ^ 3995 |
3996 | if (windowEventDescriptor) {
3997 | Object.defineProperty(window, 'event', windowEventDescriptor);
View compiled
invokeGuardedCallback
C:/Users/sadia/OneDrive/SheCodes/Full stack/app/petshop/node_modules/react-dom/cjs/react-dom.development.js:4056
4053 | function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) {
4054 | hasError = false;
4055 | caughtError = null;
> 4056 | invokeGuardedCallbackImpl$1.apply(reporter, arguments);
4057 | }
4058 | /**
4059 | * Same as invokeGuardedCallback, but instead of returning an error, it stores
View compiled
beginWork$1
C:/Users/sadia/OneDrive/SheCodes/Full stack/app/petshop/node_modules/react-dom/cjs/react-dom.development.js:23964
23961 | } // Run beginWork again.
23962 |
23963 |
> 23964 | invokeGuardedCallback(null, beginWork, null, current, unitOfWork, lanes);
| ^ 23965 |
23966 | if (hasCaughtError()) {
23967 | var replayError = clearCaughtError(); // `invokeGuardedCallback` sometimes sets an expando `_suppressLogging`.
View compiled
performUnitOfWork
C:/Users/sadia/OneDrive/SheCodes/Full stack/app/petshop/node_modules/react-dom/cjs/react-dom.development.js:22776
22773 |
22774 | if ( (unitOfWork.mode & ProfileMode) !== NoMode) {
22775 | startProfilerTimer(unitOfWork);
> 22776 | next = beginWork$1(current, unitOfWork, subtreeRenderLanes);
| ^ 22777 | stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, true);
22778 | } else {
22779 | next = beginWork$1(current, unitOfWork, subtreeRenderLanes);
View compiled
workLoopSync
C:/Users/sadia/OneDrive/SheCodes/Full stack/app/petshop/node_modules/react-dom/cjs/react-dom.development.js:22707
22704 | function workLoopSync() {
22705 | // Already timed out, so perform work without checking if we need to yield.
22706 | while (workInProgress !== null) {
> 22707 | performUnitOfWork(workInProgress);
22708 | }
22709 | }
22710 |
View compiled
renderRootSync
C:/Users/sadia/OneDrive/SheCodes/Full stack/app/petshop/node_modules/react-dom/cjs/react-dom.development.js:22670
22667 |
22668 | do {
22669 | try {
> 22670 | workLoopSync();
| ^ 22671 | break;
22672 | } catch (thrownValue) {
22673 | handleError(root, thrownValue);
View compiled
performSyncWorkOnRoot
C:/Users/sadia/OneDrive/SheCodes/Full stack/app/petshop/node_modules/react-dom/cjs/react-dom.development.js:22293
22290 | }
22291 | } else {
22292 | lanes = getNextLanes(root, NoLanes);
> 22293 | exitStatus = renderRootSync(root, lanes);
| ^ 22294 | }
22295 |
22296 | if (root.tag !== LegacyRoot && exitStatus === RootErrored) {
View compiled
(anonymous function)
C:/Users/sadia/OneDrive/SheCodes/Full stack/app/petshop/node_modules/react-dom/cjs/react-dom.development.js:11327
11324 | var callback = _queue[i];
11325 |
11326 | do {
> 11327 | callback = callback(_isSync2);
| ^ 11328 | } while (callback !== null);
11329 | }
11330 | });
View compiled
unstable_runWithPriority
C:/Users/sadia/OneDrive/SheCodes/Full stack/app/petshop/node_modules/scheduler/cjs/scheduler.development.js:468
465 | currentPriorityLevel = priorityLevel;
466 |
467 | try {
> 468 | return eventHandler();
| ^ 469 | } finally {
470 | currentPriorityLevel = previousPriorityLevel;
471 | }
View compiled
runWithPriority$1
C:/Users/sadia/OneDrive/SheCodes/Full stack/app/petshop/node_modules/react-dom/cjs/react-dom.development.js:11276
11273 |
11274 | function runWithPriority$1(reactPriorityLevel, fn) {
11275 | var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);
> 11276 | return Scheduler_runWithPriority(priorityLevel, fn);
11277 | }
11278 | function scheduleCallback(reactPriorityLevel, callback, options) {
11279 | var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);
View compiled
flushSyncCallbackQueueImpl
C:/Users/sadia/OneDrive/SheCodes/Full stack/app/petshop/node_modules/react-dom/cjs/react-dom.development.js:11322
11319 | try {
11320 | var _isSync2 = true;
11321 | var _queue = syncQueue;
> 11322 | runWithPriority$1(ImmediatePriority$1, function () {
| ^ 11323 | for (; i < _queue.length; i++) {
11324 | var callback = _queue[i];
11325 |
View compiled
flushSyncCallbackQueue
C:/Users/sadia/OneDrive/SheCodes/Full stack/app/petshop/node_modules/react-dom/cjs/react-dom.development.js:11309
11306 | Scheduler_cancelCallback(node);
11307 | }
11308 |
> 11309 | flushSyncCallbackQueueImpl();
11310 | }
11311 |
11312 | function flushSyncCallbackQueueImpl() {
View compiled
discreteUpdates$1
C:/Users/sadia/OneDrive/SheCodes/Full stack/app/petshop/node_modules/react-dom/cjs/react-dom.development.js:22420
22417 | if (executionContext === NoContext) {
22418 | // Flush the immediate callbacks that were scheduled during this batch
22419 | resetRenderTimer();
> 22420 | flushSyncCallbackQueue();
| ^ 22421 | }
22422 | }
22423 | }
View compiled
discreteUpdates
C:/Users/sadia/OneDrive/SheCodes/Full stack/app/petshop/node_modules/react-dom/cjs/react-dom.development.js:3756
3753 | isInsideEventHandler = true;
3754 |
3755 | try {
> 3756 | return discreteUpdatesImpl(fn, a, b, c, d);
| ^ 3757 | } finally {
3758 | isInsideEventHandler = prevIsInsideEventHandler;
3759 |
View compiled
dispatchDiscreteEvent
C:/Users/sadia/OneDrive/SheCodes/Full stack/app/petshop/node_modules/react-dom/cjs/react-dom.development.js:5889
5886 | flushDiscreteUpdatesIfNeeded(nativeEvent.timeStamp);
5887 | }
5888 |
> 5889 | discreteUpdates(dispatchEvent, domEventName, eventSystemFlags, container, nativeEvent);
5890 | }
5891 |
5892 | function dispatchUserBlockingUpdate(domEventName, eventSystemFlags, container, nativeEvent) {
View compiled
TO use react-hook-forms, theres some fix to work:
The inputs fields calls the register function. This function has 2 params:
register(field_name <- string, options <- object);
In your case, you need to call it like that:
<input type='email' name='email' id='email' ref={register("email", {required:true}) } />
<input type='password' name='password' id='password'
ref={register("password", {required:true, minLength:6, maxLength: 10} )} />
You're calling the error object the wrong way. Thats how you should call it:
const { register, handleSubmit, formState: { errors }, reset } = useForm();
The last error I found after the fix is about the way you call register function.
You are setting the register at the ref property. According to the docs, you should just set the register in the component, and this will return all the props:
<input type='email' id='email' {...register("email", {required:true}) } />
Here at the Sources, you can read and deep in "why am I doing this?" =):
register():
https://react-hook-form.com/api/useform/register
errors:
https://react-hook-form.com/api/useformstate/errormessage
I'll add here some tips to help you found the solution to new errors:
Make a path to discover where to focus: When you have an error, you need to found exactly what's causing it. In your case, the console was accusing a file that isn't even in your main folders (that was a dependency). In that case, remove code, try to delete some code, and see if the project works. If works, you now is somewhere there, and do again filtering the removed code.
Go to the official docs/demos and compare your code: I've never used react-hook-forms, But a look at the docs helps me to find the errors.
I'm trying to integrate third-party npm library (editorjs like npm package npm i #editorjs/editorjs --save-dev) to ember application with auto loading "ember-auto-import": "^1.5.3",
Everything works fine without fastboot, but under fastboot application crashing with following error:
nodejs_1 | TypeError: Cannot read property 'syscall' of null
nodejs_1 | at AppendOpcodes.evaluate (/tmp/broccoli-1Awdijh61s6pE/out-475-append_ember_auto_import_analyzer/assets/#glimmer/runtime.js:2003:1)
nodejs_1 | at LowLevelVM.evaluateSyscall (/tmp/broccoli-1Awdijh61s6pE/out-475-append_ember_auto_import_analyzer/assets/#glimmer/runtime.js:4923:1)
nodejs_1 | at LowLevelVM.evaluateInner (/tmp/broccoli-1Awdijh61s6pE/out-475-append_ember_auto_import_analyzer/assets/#glimmer/runtime.js:4879:1)
nodejs_1 | at LowLevelVM.evaluateOuter (/tmp/broccoli-1Awdijh61s6pE/out-475-append_ember_auto_import_analyzer/assets/#glimmer/runtime.js:4871:1)
nodejs_1 | at JitVM.next (/tmp/broccoli-1Awdijh61s6pE/out-475-append_ember_auto_import_analyzer/assets/#glimmer/runtime.js:5815:1)
nodejs_1 | at TemplateIteratorImpl.next (/tmp/broccoli-1Awdijh61s6pE/out-475-append_ember_auto_import_analyzer/assets/#glimmer/runtime.js:5944:1)
nodejs_1 | at RootState.render (/tmp/broccoli-1Awdijh61s6pE/out-475-append_ember_auto_import_analyzer/assets/#ember/-internals/glimmer/index.js:8771:1)
nodejs_1 | at runInAutotrackingTransaction (/tmp/broccoli-1Awdijh61s6pE/out-475-append_ember_auto_import_analyzer/assets/#glimmer/validator.js:106:1)
nodejs_1 | at /tmp/broccoli-1Awdijh61s6pE/out-475-append_ember_auto_import_analyzer/assets/#ember/-internals/glimmer/index.js:9069:1
nodejs_1 | at inTransaction (/tmp/broccoli-1Awdijh61s6pE/out-475-append_ember_auto_import_analyzer/assets/#glimmer/runtime.js:1959:1)
nodejs_1 | at InertRenderer._renderRoots (/tmp/broccoli-1Awdijh61s6pE/out-475-append_ember_auto_import_analyzer/assets/#ember/-internals/glimmer/index.js:9043:1)
nodejs_1 | at InertRenderer._renderRootsTransaction (/tmp/broccoli-1Awdijh61s6pE/out-475-append_ember_auto_import_analyzer/assets/#ember/-internals/glimmer/index.js:9104:1)
nodejs_1 | at InertRenderer._revalidate (/tmp/broccoli-1Awdijh61s6pE/out-475-append_ember_auto_import_analyzer/assets/#ember/-internals/glimmer/index.js:9146:1)
nodejs_1 | at invokeWithOnError (/tmp/broccoli-1Awdijh61s6pE/out-475-append_ember_auto_import_analyzer/assets/backburner.js:347:1)
nodejs_1 | at Queue.flush (/tmp/broccoli-1Awdijh61s6pE/out-475-append_ember_auto_import_analyzer/assets/backburner.js:229:1)
nodejs_1 | at DeferredActionQueues.flush (/tmp/broccoli-1Awdijh61s6pE/out-475-append_ember_auto_import_analyzer/assets/backburner.js:426:1)
nodejs_1 | at Backburner._end (/tmp/broccoli-1Awdijh61s6pE/out-475-append_ember_auto_import_analyzer/assets/backburner.js:960:1)
nodejs_1 | at Backburner.end (/tmp/broccoli-1Awdijh61s6pE/out-475-append_ember_auto_import_analyzer/assets/backburner.js:710:1)
nodejs_1 | at Backburner._run (/tmp/broccoli-1Awdijh61s6pE/out-475-append_ember_auto_import_analyzer/assets/backburner.js:1009:1)
nodejs_1 | at Backburner._join (/tmp/broccoli-1Awdijh61s6pE/out-475-append_ember_auto_import_analyzer/assets/backburner.js:989:1)
nodejs_1 | at Backburner.join (/tmp/broccoli-1Awdijh61s6pE/out-475-append_ember_auto_import_analyzer/assets/backburner.js:760:1)
nodejs_1 | at Array.loopEnd (/tmp/broccoli-1Awdijh61s6pE/out-475-append_ember_auto_import_analyzer/assets/#ember/-internals/glimmer/index.js:8888:1)
nodejs_1 | at Backburner._trigger (/tmp/broccoli-1Awdijh61s6pE/out-475-append_ember_auto_import_analyzer/assets/backburner.js:1084:1)
nodejs_1 | at Backburner._end (/tmp/broccoli-1Awdijh61s6pE/out-475-append_ember_auto_import_analyzer/assets/backburner.js:979:1)
nodejs_1 | at Backburner.end (/tmp/broccoli-1Awdijh61s6pE/out-475-append_ember_auto_import_analyzer/assets/backburner.js:710:1)
nodejs_1 | at Backburner._run (/tmp/broccoli-1Awdijh61s6pE/out-475-append_ember_auto_import_analyzer/assets/backburner.js:1009:1)
nodejs_1 | at Backburner._join (/tmp/broccoli-1Awdijh61s6pE/out-475-append_ember_auto_import_analyzer/assets/backburner.js:989:1)
nodejs_1 | at Backburner.join (/tmp/broccoli-1Awdijh61s6pE/out-475-append_ember_auto_import_analyzer/assets/backburner.js:760:1)
nodejs_1 | at Array.loopEnd (/tmp/broccoli-1Awdijh61s6pE/out-475-append_ember_auto_import_analyzer/assets/#ember/-internals/glimmer/index.js:8888:1)
nodejs_1 | at Backburner._trigger (/tmp/broccoli-1Awdijh61s6pE/out-475-append_ember_auto_import_analyzer/assets/backburner.js:1084:1)
nodejs_1 | at Backburner._end (/tmp/broccoli-1Awdijh61s6pE/out-475-append_ember_auto_import_analyzer/assets/backburner.js:979:1)
nodejs_1 | at Backburner.end (/tmp/broccoli-1Awdijh61s6pE/out-475-append_ember_auto_import_analyzer/assets/backburner.js:710:1)
nodejs_1 | at Backburner._run (/tmp/broccoli-1Awdijh61s6pE/out-475-append_ember_auto_import_analyzer/assets/backburner.js:1009:1)
nodejs_1 | at Backburner._join (/tmp/broccoli-1Awdijh61s6pE/out-475-append_ember_auto_import_analyzer/assets/backburner.js:989:1)
nodejs_1 | at Backburner.join (/tmp/broccoli-1Awdijh61s6pE/out-475-append_ember_auto_import_analyzer/assets/backburner.js:760:1)
nodejs_1 | at Function.join (/tmp/broccoli-1Awdijh61s6pE/out-475-append_ember_auto_import_analyzer/assets/#ember/runloop/index.js:168:1)
nodejs_1 | at Object.hash.success (/tmp/broccoli-1Awdijh61s6pE/out-475-append_ember_auto_import_analyzer/assets/addon-tree-output/#ember-data/adapter/rest.js:919:1)
nodejs_1 | at fire (/app/node_modules/jquery-deferred/lib/jquery-callbacks.js:78:30)
nodejs_1 | at Object.fireWith (/app/node_modules/jquery-deferred/lib/jquery-callbacks.js:188:7)
nodejs_1 | at Object.fire [as resolve] (/app/node_modules/jquery-deferred/lib/jquery-callbacks.js:195:10)
nodejs_1 | at dataHandler (/app/node_modules/najax/lib/najax.js:167:13)
nodejs_1 | at IncomingMessage.<anonymous> (/app/node_modules/najax/lib/najax.js:198:9)
nodejs_1 | at IncomingMessage.emit (events.js:322:22)
nodejs_1 | at IncomingMessage.EventEmitter.emit (domain.js:482:12)
nodejs_1 | at endReadableNT (_stream_readable.js:1187:12)
nodejs_1 | at processTicksAndRejections (internal/process/task_queues.js:84:21)
fastboot mode check like this.fastboot.isFastBoot not solve the problem and looks like error throwing even if I just import #editorjs/editorjs. Maybe someone came across, so ready for any information to get direction for digg in.
Example of created component:
import Component from '#ember/component';
import EditorJS from '#editorjs/editorjs';
import { inject as service } from '#ember/service';
export default Component.extend({
fastboot: service(),
didInsertElement() {
if (!this.fastboot.isFastBoot) {
const editor = new EditorJS({
holder: this.elementId
});
}
}
});
Environment:
DEBUG: -------------------------------
index.js:194 DEBUG: Ember : 3.18.0
index.js:194 DEBUG: Ember Data : 3.17.0
index.js:194 DEBUG: jQuery : 3.5.0
index.js:194 DEBUG: Ember Bootstrap : 2.8.1
index.js:194 DEBUG: -------------------------------
Update:
Looks like the problem in third-party npm library, cause didInsertElement shouldn't work at all in fastboot
As workaround I added this lib as incompatible JavaScript
app.import('vendor/fastboot-incompatible.js', {
using: [
{
transformation: 'fastbootShim'
}
]
});
And looks like this approach solve problem. But any way, the question still actual cause I wanna to understand crash reason, after this error fastboot require reloading and doesn't work more. Expected behavior -
some error without total crash.
I have a large object which I have no control over, fields might vary a lot:
Error ==>> { MongoError: The dollar ($) prefixed field '$' in
'value.external.originalRequest.rawRequest.ns2:LoadData.Orders.0.Order.0.TotalThirdPartyCharge.0.CurrencyValue.0.$'
is not valid for storage. 0|lt-check | at
Function.MongoError.create
(/home/ops/lt-checkin-api/node_modules/mongodb-core/lib/error.js:31:11)
0|lt-check | at
/home/ops/lt-checkin-api/node_modules/mongodb-core/lib/connection/pool.js:497:72
0|lt-check | at authenticateStragglers
(/home/ops/lt-checkin-api/node_modules/mongodb-core/lib/connection/pool.js:443:16)
0|lt-check | at Connection.messageHandler
(/home/ops/lt-checkin-api/node_modules/mongodb-core/lib/connection/pool.js:477:5)
0|lt-check | at Socket.
(/home/ops/lt-checkin-api/node_modules/mongodb-core/lib/connection/connection.js:333:22)
0|lt-check | at Socket.emit (events.js:159:13) 0|lt-check | at
addChunk (_stream_readable.js:265:12) 0|lt-check | at
readableAddChunk (_stream_readable.js:252:11) 0|lt-check | at
Socket.Readable.push (_stream_readable.js:209:10) 0|lt-check | at
TCP.onread (net.js:608:20) 0|lt-check | name: 'MongoError',
0|lt-check | message: 'The dollar ($) prefixed field \'$\' in
\'value.external.originalRequest.rawRequest.ns2:LoadData.Orders.0.Order.0.TotalThirdPartyCharge.0.CurrencyValue.0.$\'
is not valid for storage.', 0|lt-check | ok: 0, 0|lt-check |
errmsg: 'The dollar ($) prefixed field \'$\' in
\'value.external.originalRequest.rawRequest.ns2:LoadData.Orders.0.Order.0.TotalThirdPartyCharge.0.CurrencyValue.0.$\'
is not valid for storage.', 0|lt-check | code: 52, 0|lt-check |
codeName: 'DollarPrefixedFieldName' }
Here the key causing the error:
"rawRequest": {
"ns2:LoadData": {
"$": {
"xmlns:ns2": "http://schemas.3gtms.com/tms/v1/tns"
},
"BatchInfo": [
{
"$": {
"xmlns": ""
},
As there are multiple keys starting with $.
Is there a setting in mongoose or mongoDB itself to insert anything without validating the request coming in.
Was going to create a new plugin but #Anirudh helped me find this package in the comment
https://www.npmjs.com/package/mongo-escape
To use it, just before your insert query escape you object using the above package.
var escapeForMongo = require('mongo-escape').escape;
userInput = escapeForMongo({
'foo': 'bar',
'ba.z': {
'$in': 'quz'
}
})
function escapeMongo(obj) {
return JSON.parse(
JSON.stringify(obj),
function(p, v) {
if ((p[0] === '$') || (p.includes('.'))) {
this[p.replace(/\$/g, '\uFF04').replace(/\./g, '\uFF0E')] = v;
return;
}
return v;
}
)
}
userInput = {
'foo': 'bar',
'ba.z': {
'$in': 'quz'
}
}
console.log(userInput)
console.log(escapeMongo(userInput))
You can use JSON.parse to process a JSON string before creating object.
I'm trying to use liquibase (3.5.5) from an existing database (on MySQL).
I've used the generateChangeLog command to generate a db.changelog.xml file.
C:/liquibase-3.5.5/liquibase.bat --driver=com.mysql.jdbc.Driver ^
--classpath=C:/Libraries/mysql-connector-java-5.1.37-bin.jar ^
--changeLogFile=db.changelog.xml ^
--url="jdbc:mysql://vbalder/izalerting" ^
--username=* ^
--password=* ^
generateChangeLog
result: Liquibase 'generateChangeLog' Successful
The generated db.changelog.xml file contains changeSets with author BGADEYNE (generated) and id's who are prepended by 1533645947580-. e.g. 1533645947580-1
Added logicalFilePath="db.changelog.xml" to the databaseChangeLog tag
I've used the changelogSync command to create and fill the DATABASECHANGELOG and DATABASECHANGELOGLOCK tables. They do contain rows for each changeSet.
C:/liquibase-3.5.5/liquibase --driver=com.mysql.jdbc.Driver ^
--classpath=C:/Libraries/mysql-connector-java-5.1.37-bin.jar ^
--changeLogFile=db.changelog.xml ^
--url="jdbc:mysql://vbalder/izalerting" ^
--username=izalerting ^
--password=alfa ^
changelogSync
result: Liquibase 'changelogSync' Successful
Created a CDI component to execute the db.changelog.xml when the application starts.
Added maven dependency:
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-cdi</artifactId>
<version>3.5.5</version>
</dependency>
Added CLI component:
#Dependent
public class LiquibaseProducer {
#Resource(name="java:/izalerting")
private DataSource dbConnection;
#Produces #LiquibaseType
public CDILiquibaseConfig createConfig() {
CDILiquibaseConfig config = new CDILiquibaseConfig();
config.setChangeLog("be/uzgent/iz/alerting/liquibase/db.changelog.xml");
config.setContexts("non-legacy");
return config;
}
#Produces #LiquibaseType
public DataSource createDataSource() throws SQLException {
return dbConnection;
}
#Produces #LiquibaseType
public ResourceAccessor create() {
return new ClassLoaderResourceAccessor(getClass().getClassLoader());
}
}
When deploying the application to WildFly i can see this
2018-08-07 15:07:09,234 ERROR [stderr] (MSC service thread 1-4) INFO 8/7/18 3:07 PM: liquibase.integration.cdi.CDILiquibase: Booting Liquibase 3.5.4
2018-08-07 15:07:09,285 ERROR [stderr] (MSC service thread 1-4) INFO 8/7/18 3:07 PM: liquibase: Successfully acquired change log lock
2018-08-07 15:07:09,781 ERROR [stderr] (MSC service thread 1-4) INFO 8/7/18 3:07 PM: liquibase: Reading from PUBLIC.DATABASECHANGELOG
2018-08-07 15:07:09,814 ERROR [stderr] (MSC service thread 1-4) SEVERE 8/7/18 3:07 PM: liquibase: db.changelog.xml: db.changelog.xml::1533645947580-1::BGADEYNE (generated): Change Set db.changelog.xml::1533645947580-1::BGADEYNE (generated) failed. Error: Table "ALERTRESULT" already exists; SQL statement:
2018-08-07 15:07:09,815 ERROR [stderr] (MSC service thread 1-4) CREATE TABLE PUBLIC.alertresult (triggerid VARCHAR(255) NOT NULL, application VARCHAR(40) NOT NULL, resultid INT NOT NULL, subject VARCHAR(255), content CLOB, contenturl CLOB, executetime TIMESTAMP, html BOOLEAN DEFAULT TRUE NOT NULL, alertlevel VARCHAR(20) DEFAULT 'INFO' NOT NULL, closable BOOLEAN DEFAULT TRUE NOT NULL, screenwidth INT, screenheight INT) [42101-173] [Failed SQL: CREATE TABLE PUBLIC.alertresult (triggerid VARCHAR(255) NOT NULL, application VARCHAR(40) NOT NULL, resultid INT NOT NULL, subject VARCHAR(255), content CLOB, contenturl CLOB, executetime TIMESTAMP, html BOOLEAN DEFAULT TRUE NOT NULL, alertlevel VARCHAR(20) DEFAULT 'INFO' NOT NULL, closable BOOLEAN DEFAULT TRUE NOT NULL, screenwidth INT, screenheight INT)]
2018-08-07 15:07:09,816 ERROR [stderr] (MSC service thread 1-4) INFO 8/7/18 3:07 PM: liquibase: db.changelog.xml::1533645947580-1::BGADEYNE (generated): Successfully released change log lock
The DATABASECHANGELOG table contains a row for each changeSet.
+------------------+-----------------------+-------------------+-----------+
| # ID | AUTHOR | FILENAME | EXECTYPE |
+------------------+-----------------------+-------------------+-----------+
| 1533645947580-1 | BGADEYNE (generated) | db.changelog.xml | EXECUTED |
| 1533645947580-2 | BGADEYNE (generated) | db.changelog.xml | EXECUTED |
| 1533645947580-3 | BGADEYNE (generated) | db.changelog.xml | EXECUTED |
| 1533645947580-4 | BGADEYNE (generated) | db.changelog.xml | EXECUTED |
| 1533645947580-5 | BGADEYNE (generated) | db.changelog.xml | EXECUTED |
| 1533645947580-6 | BGADEYNE (generated) | db.changelog.xml | EXECUTED |
| 1533645947580-7 | BGADEYNE (generated) | db.changelog.xml | EXECUTED |
| 1533645947580-8 | BGADEYNE (generated) | db.changelog.xml | EXECUTED |
| 1533645947580-9 | BGADEYNE (generated) | db.changelog.xml | EXECUTED |
| 1533645947580-10 | BGADEYNE (generated) | db.changelog.xml | EXECUTED |
| 1533645947580-11 | BGADEYNE (generated) | db.changelog.xml | EXECUTED |
| 1533645947580-12 | BGADEYNE (generated) | db.changelog.xml | EXECUTED |
| 1533645947580-13 | BGADEYNE (generated) | db.changelog.xml | EXECUTED |
| 1533645947580-14 | BGADEYNE (generated) | db.changelog.xml | EXECUTED |
| 1533645947580-15 | BGADEYNE (generated) | db.changelog.xml | EXECUTED |
| 1533645947580-16 | BGADEYNE (generated) | db.changelog.xml | EXECUTED |
| 1533645947580-17 | BGADEYNE (generated) | db.changelog.xml | EXECUTED |
| 1533645947580-18 | BGADEYNE (generated) | db.changelog.xml | EXECUTED |
| 1533645947580-19 | BGADEYNE (generated) | db.changelog.xml | EXECUTED |
| 1533645947580-20 | BGADEYNE (generated) | db.changelog.xml | EXECUTED |
+------------------+-----------------------+-------------------+-----------+
Does anyone know what I'm doiing wrong here?
instead of
#Resource(name="java:/izalerting")
I needed to use
#Resource(lookup="java:/izalerting")
on wildfly 9