refactor(core): log warnings for non-prod node envs

This commit is contained in:
Braks
2022-10-18 19:04:22 +02:00
parent 48366780ce
commit 395fcd2aab
10 changed files with 34 additions and 18 deletions
@@ -3,6 +3,7 @@ import { NodeWrapper } from '../../components'
import type { GraphNode, HandleConnectable, NodeComponent } from '../../types'
import { useVueFlow } from '../../composables'
import { Slots } from '../../context'
import { warn } from '../../utils'
const slots = inject(Slots)
@@ -45,7 +46,7 @@ const getType = (type?: string, template?: GraphNode['template']) => {
const slot = slots?.[`node-${name}`]
if (!slot?.({})) {
console.warn(`[vueflow]: Node type "${type}" not found and no node-slot detected. Using fallback type "default".`)
warn(`Node type "${type}" not found and no node-slot detected. Using fallback type "default".`)
return false
}