Skip to content

Commit 55cc4af

Browse files
committedJan 16, 2022
fix(ssr): remove missing ssr directive transform error
1 parent 4dd0f34 commit 55cc4af

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed
 

‎packages/compiler-ssr/src/errors.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,12 @@ export function createSSRCompilerError(
1717
}
1818

1919
export const enum SSRErrorCodes {
20-
X_SSR_CUSTOM_DIRECTIVE_NO_TRANSFORM = DOMErrorCodes.__EXTEND_POINT__,
21-
X_SSR_UNSAFE_ATTR_NAME,
20+
X_SSR_UNSAFE_ATTR_NAME = DOMErrorCodes.__EXTEND_POINT__,
2221
X_SSR_NO_TELEPORT_TARGET,
2322
X_SSR_INVALID_AST_NODE
2423
}
2524

2625
export const SSRErrorMessages: { [code: number]: string } = {
27-
[SSRErrorCodes.X_SSR_CUSTOM_DIRECTIVE_NO_TRANSFORM]: `Custom directive is missing corresponding SSR transform and will be ignored.`,
2826
[SSRErrorCodes.X_SSR_UNSAFE_ATTR_NAME]: `Unsafe attribute name for SSR.`,
2927
[SSRErrorCodes.X_SSR_NO_TELEPORT_TARGET]: `Missing the 'to' prop on teleport element.`,
3028
[SSRErrorCodes.X_SSR_INVALID_AST_NODE]: `Invalid AST node during SSR transform.`

‎packages/compiler-ssr/src/transforms/ssrTransformElement.ts

+2-10
Original file line numberDiff line numberDiff line change
@@ -179,18 +179,10 @@ export const ssrTransformElement: NodeTransform = (node, context) => {
179179
if (!hasDynamicVBind) {
180180
node.children = [createInterpolation(prop.exp, prop.loc)]
181181
}
182-
} else {
182+
} else if (!hasDynamicVBind) {
183183
// Directive transforms.
184184
const directiveTransform = context.directiveTransforms[prop.name]
185-
if (!directiveTransform) {
186-
// no corresponding ssr directive transform found.
187-
context.onError(
188-
createSSRCompilerError(
189-
SSRErrorCodes.X_SSR_CUSTOM_DIRECTIVE_NO_TRANSFORM,
190-
prop.loc
191-
)
192-
)
193-
} else if (!hasDynamicVBind) {
185+
if (directiveTransform) {
194186
const { props, ssrTagParts } = directiveTransform(
195187
prop,
196188
node,

0 commit comments

Comments
 (0)
Please sign in to comment.